I have a page that needs a link to a User page with a given ID. So if the ID is 1234, I want the final href to be /user/1234.
I tried to use
link_to "User", {:controller => "user", :action => "show", :id => 1234 }
This gave me the URL
/assets?action=show&controller=user&id=1234
What should the link_to parameters be?
I would encourage you to use named routes if possible (let Rails to the work for you). That is, add a route to your routes file:
You can then write your link_to method as:
or