Archive | December 2010

Add a query string parameter to link_to links

This is a little obscure, but easy enough.

If you want to add a query string parameter to a link generated using the link_to helper function, try the following:

link_to users_path(:filter => 'boss')

That will generate this link (for the example.com domain of course):


http://www.example.com/users?filter=boss

Simples.

Follow

Get every new post delivered to your Inbox.