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 trial

Ruby

Devise on login user goes to their profile?

When a user logs in I would like them to get directed to their profile page. Up to this point in the tutorials that is not accomplished, maybe it is later?

Looking through devise docs I found the following code but I don't know what goes in the definition to get this to work.

class ApplicationController < ActionController::Base protect_from_forgery

def after_sign_in_path_for(resource)
           #what goes here to redirect to /profile_name
 end

end

Thanks for any advise you can offer.

Rich

2 Answers

I found this wiki. Hopefully, is it what you're looking?

That's what I'm looking for but current_user_path does not work, don't know what goes there.