Friday, November 12, 2010

[Rails] Devise after_sign_up_path_for - how to?

Hi,

I'm new to devise and I'm having a problem overwriting a controller.

After sign-up I want the user to go to a static page.

In the controllers folder I have created
users/registrations_controller.rb

class Users::RegistrationsController < Devise::RegistrationsController

def after_sign_up_path_for(resource)
puts "If I coould see this..."
redirect_to account_created_path
end
end

I have the views for users/registrations as instructed by the
documentation.

In routes I have:

devise_for :users, :controllers => { :registrations =>
"users/registrations" }

match "/account_created" => "info#account_created", :as =>
:account_created

root :to => "accounts#index"

But after sign up it always goes to root. Not to the account created
page.

Any hints how to solve the problem?


Thanks.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate