How can I strip request values out of my Rails url?

In my Rails 3 application, I list many items on the homepage. Some of them are obscure, and I would like to limit my list to only popular items unless the user clicks a specific link that basically "zeroes out" the limiter.

What I have now works, but when the user chooses to "Show all items", I end up with a ugly url:

http://myapp.com/?limiter=0

Is there any way that I can strip that out so that the user does not see the ugly attribute at the end of the url?

Answers


No, don't use POST. POST is only supposed to be used when you are making a state change on the server. Use an AJAX GET if you really need to do this.

Better yet, get used to seeing GET parameters like this. It's normal. And, it's like that for a reason: it allows bookmarking a resource, including whatever settings are needed to reproduce the request later.

Read up on REST. Learn it. Live it. Love it.


Need Your Help

Smooth aspect change during orientation change

iphone objective-c ios opengl-es-2.0 aspect-ratio

When the screen of the iPhone orientation changes, I adjust my projection matrix of my 3D rendering to the new aspect value. However, doing this in either willRotateToInterfaceOrientation or

Reflection: Get all subproperties

c# reflection propertyinfo

I have a List that contains objects and each of these objects contains a lot of properties of several types, and each of these properties contains subproperties aswell.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.