Ruby on Rails Tuesday, June 25, 2013

Does anyone know how to use escape parentheses in routes so I can use them in URLs? They currently denote optional params, but I can't find documentation on how to escape that.


What I want is:

Given I have a route: match "foo(:id)" => "foos#show"
When I go to "/foo(3)"
Then params[:id] should be "3"

But currently params[:id] returns "(3)"

I don't want to make :id optional.

Thanks!
Rick

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0e323be4-367e-4d79-a964-34905757f526%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment