ruby on rails - How to set an "account" route? -


In my routes, I have:

  Resources: Users do the resource: articles End   

that will allow the user to edit their profile settings to go to their URL:

  http: // localhost / users / foobar / Edit   

How can I create it so that the URL will look like:

  http: // localhost / account   

I want users to use this URL Can edit the details of the account: http: // localhost / account and http: // localhost / users / foobar / edit .

At the same time, to display user's articles. I need URL:

  http: // localhost / users / foobar / articles    

You need to create that path:

  account 'account (/: id)' = & gt; If the user's ID is required then 'edit' with the user   

(/: id).

Comments