Arbitrary number of parameters in route
Reported by Kai Schlichting | April 16th, 2008 @ 11:24 AM | in 0.9.4
There should be support for routing urls with a dynamic part for parameters. E.g., routes like in rails (/myresource/:id/*path_info) would be very nice to have urls like /myresource/5/foo/bar with request.path_info == "foo/bar" in controller.
My current workaround isn't nice because I'm having URLs like /myresource/5/foo&bar with routing /myresource/:id/:parameters.
That's why i request for any solution to handle arbitrary number of parameters in routes
Comments and changes to this ticket
-
Jonathan Younger (daikini) April 16th, 2008 @ 10:13 PM
Merb's routing already does what you want using regular expressions.
r.match(%r[^/myresource/([0-9]+)/(.+)]).to(:controller => "myresources", :id => "[1]", :parameters => "[2]", :action => "show")
/myresource/5/foo/bar
params[:id] == "5"
params[:parameters] == "foo/bar"
-
Ezra Zygmuntowicz April 18th, 2008 @ 12:01 AM
- → Milestone changed from to 0.9.4
- → State changed from new to resolved
Closing this as solved.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
