Rails 4: devise custom routes -
I have to be an "account settings" page, which is for editing name and password, and a "edit profile" The page that is to update the profile picture and personal information is the default design path / user for user edits, but I want to make it '/ users /: id / account'. I also want to edit profile editing page to path '/ users /: id / edit_profile' after the instructions on wiki wiki, I was able to change signup and enter paths, but this is not work for others Does
config / routes.rb
devise_for: user ,: path = & gt; '',: Path_name = & gt; {: Sign_in = & gt; "Signin" ,: sign_up = & gt; "Signup",: Edit & gt; "Profile"} Resources: Users only: [index ,: show] Resources: Project root 'static_pages # home' match '/ help', for: 'static_pages # help', via: 'get' match '/ about ', To get', 'get' '
through the rake routes
:' static_pages # contact ', via:' static_pages # about ', via : 'get' match '/ contact' new_user_session /signin(.:format GET) will / session # new user_session post /signin(.:format) will / session # destroy_user_session make /sign_out(.:format DELETE) wills / session # user_password delete the post /password (.:format) wills / password # new_user_password / password / new (. : Format to achieve) will / password # receive new edit_user_password /password/edit(.:format) will / password # Edit Patch / password. (Format) Make / password # Update / password. (Format) Make / password # update canceled Kren_usr_ registration G ET /cancel(.:format) will / registration # cancel user_registration Post / will / registration # new_user_registration /signup(.:format gET) will / registration # receive new edit_user_registration /edit(.:format) / Registration will # Edit PATCH create / wille / registration # update PUT / Siyt / registration # UPDATE DELETE / will / registration # delete users /users(.:format) that # directory user who /users/:id(.:format GET) received the # show projects / Projects (. Format) projects # index Post / projects. (Format) Projects # Nwa_projekt Create / project / new (.: Format) Projects # New Adit_projekt GET / PR ojects /: id / editing (. Format) projects # Edit Project / projects /: id (.: format) projects # show PATCH /projects/:id(.:format) projects # updated PUT / projects /: id. (format) projects # updated /projects/:id(.:format DELETE ) Projects # get root obtained / static_pages # d Get help /help (.:format) about /about(.:format About # help static_pages) # About static_pages Contact GET / Contact (.: Format) static_pages # contact
Thank you!
I want to create / user /: id / account '
Why do not you do the following:
# config / routes.rb Processing: user, path_name: {edit: "account"} Get: edit_profile # - & gt; I think you have "edit_profile" controller action? End
This will give you the following routes:
domain.com/users/:id/account # - & gt; Domain.com/users/:id/edit_profile # - & gt; Edit_profile
-
Recommend that you can not directly edit the user
object with devices
It is more about defining the system's authentication
system.
Comments
Post a Comment