Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8063821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:10:08+00:00 2026-06-05T11:10:08+00:00

After a user signs up to my Rails 3.2.3 app which uses Devise, an

  • 0

After a user signs up to my Rails 3.2.3 app which uses Devise, an after_create callback is triggered which attempts to create an Organisation record.

If this create fails validation, how can I get the error messages to display? Should I override the devise controller? Thing is, the errors are related to the creation of an Organisation, not a User (and I have a pretty vanilla devise User model set-up).

I’m doing something like this in the User model:

# after_create callback method
...
    unless new_org_user.save
      errors.add("Warning", "Organisation is invalid" )
    end
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:10:09+00:00Added an answer on June 5, 2026 at 11:10 am

    Since you are firing the event in the after_create callback the record is already successfully created so no flash message will apear.

    Why dont you try to move it to relation association instead and require validation of child like

    class User < ActiveRecord::Base
      has_one :organization
      accepts_nested_attributes_for :organization
    end
    
    class Organization < ActiveRecord::Base
      belongs_to :user
    end
    

    This way if organization is not valid it will fail the validation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it true that after a user signs up, a sql table is create
After loading the Rails console, how should I sign in a user? Devise provides
I'm using Devise in a Rails 3 app, but in this case, a user
So my user signs up from the Android App on his phone and after
I use Ruby On Rails and devise gem. I want redirect user after registration,
I'm trying to create a Rails 3 app with an API. I use Devise
After a user signs in and his password is verified, I need to store
Using Rails 3.1.3 with Devise 1.5.3. My app has accounts and users. Each account
I have this application where I use Devise and, after login the user is
I'm using devise with my rails 3 app. For some reason the sign in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.