Show a modal right after signup?

Posted by user1494756 on Stack Overflow See other posts from Stack Overflow or by user1494756
Published on 2012-07-01T21:00:52Z Indexed on 2012/07/01 21:15 UTC
Read the original article Hit count: 198

When a user signup at my page I want them to be redirected to the root_path(this I have figured out how to do in the user controller). But then I want a modal to show in front of this page(and this should only happen the first time the user see this root/home page(like a flash message).

Here is my create method in the user controller:

def create
    @user = User.new(params[:user])
    if @user.save
      sign_in @user
      redirect_to root_path
    else
      render 'new'
    end
  end

The modal is placed in app/views/layouts/_modal.html.erb. Does anybody know how to make this happen?

(Jepp, I am a newbie :)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about twitter-bootstrap