Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Derek Saunders
Derek Saunders
5,167 Points

Edit 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?

Derek Saunders
Derek Saunders
5,167 Points

Dino Paškvan Is there anyway you could help me out on this one as well? :)

I 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

Okay, 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
Derek Saunders
5,167 Points

Dino 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
Derek Saunders
5,167 Points

Dino Paškvan thank you very much you are always a big help!

Glad I could help :)