简体   繁体   中英

Devise show user page

How would I create a page that allows the user to view their profile.

Anyone worked around/see/know an answer this problem? I would greatly appreciate it.

This is not so much a devise problem as a simple routing issue:

Just create a ProfileController and an action Show and then do the following in your routes.rb :

match '/profile', :to => "profile#show"

Inside your profile#show action:

def show
  @profile = current_user
end

and in the view you display the information about the user that is stored in @profile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM