Rails: URL helper for combining URL parameters?

How do I create a helper or use the built-in helper link_toto combine URL parameters?

For example, let's say I'm on a page with a URL parameter status:

http://example.com/items?status=new

I have one more media link that I would like to add to this, for example:

http://example.com/items?status=new&carrier=fedex

So basically the helper would detect if there are any parameters in the url, and then add the parameter to this.

+5
source share
1 answer

You want to use the request object. Here is a good entry: Requesting an object in Rails

+3
source

All Articles