Question

I'm generating links from the home page (controller = 'landings') via a partial containing:

<%= link_to t.to_s, assets_path, :name => t.to_s %>

where assets/index is the controller/method that I'd like to pass the :name to. However, after I've clicked the link, and control is thrown to the assets/index controller, params.to_s = "actionindexcontrollerassets"

I'd appreciate any help.

Was it helpful?

Solution

Extra parameters should be arguments to url/path helpers. This will do what you want:

<%= link_to t.to_s, assets_path( :name => t.to_s) %>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top