Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDerek Saunders
5,167 PointsEdit User Controller
I want to make the authenticated route go to the devise/registrations#new when I put this
authenticated :user do
root to: "devise/registrations#edit", as: :authenticated_root
end
It says uninitialized constant RegistrationsController
what can I do so that it shows the edit user page once logged in?
Dino Paškvan
Courses Plus Student 44,108 PointsI can give it a go. :) Could you, please, clarify the situation a bit? Do you want to redirect users to the edit user page every time they log in or only after they sign up?
3 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsOkay, then this is what you want to do. Add this to your application controller:
def after_sign_in_path_for(resource)
edit_user_registration_path
end
This will redirect users to their edit user page once they log in/sign up (source). Also, when tinkering with Devise, it really has a well documented wiki which you can find here: https://github.com/plataformatec/devise/wiki
Most of the stuff you'll want to do will probably be there somewhere.
Derek Saunders
5,167 PointsDino Paškvan yes every time they log in would be awesome, as well as after signing up so they can add images as well.
Derek Saunders
5,167 PointsDino Paškvan thank you very much you are always a big help!
Dino Paškvan
Courses Plus Student 44,108 PointsGlad I could help :)
Derek Saunders
5,167 PointsDerek Saunders
5,167 PointsDino Paškvan Is there anyway you could help me out on this one as well? :)