Im trying to figure out how to get a dynamic link for example
- /users/user1/show
- /users/user1/edit
or - /profiles/1/
How would I create a route that I could insert in my views like a view_profile_path and that would include the id or username of a user?
Actually, I think you need something like this in config/routes.rb
You can later check your REST-ful resource routes by issuing the command:
This way you have a more natural approach to your routes in which your users will be bound to one or more profiles, therefore you may use something like:
to create an appropriate link to a user’s profile.