Adding GET parameters to Rails Resource · Oct 17, 02:24 PM

If you have a standard resource in rails (map.resource :posts), but want to add additional parameters to the get request for a single post, the following won’t work:

post_path(@post, :version => @post.version - 1)

But if you specify the post id explicitly, it will work:

post_path(:id => @post, :version => @post.version - 1)

That’s it…As you might guess from the example, this is how I’m looking at different versions of a resource using acts_as_versioned.

---

Comment

Commenting is closed for this article.