I’m trying to configure a route to display a profile page about the user.
At the moment, I’ve created a custom controller for this page using:
I generated my controller using:
rails g controller user-profile
and I made corresponding views.
I’m trying to do something like this:
/user-profile/:id
I’m using devise. How do I configure the route for this?
I would do it this way (the resulting profile will be public):
Add the route:
Add the related action in your controller:
You’re then free to use the
@uservariable inapp/views/user-profile/show.html.erb.