#393 √ resolved
GMFlash

[PATCH] #url does not always generate routes with query params

Reported by GMFlash | July 8th, 2008 @ 11:30 AM | in 0.9.4

# In config/router.rb I have r.resource :posts

# Generates based on the default route, so far so good...
>> merb.url(:controller => "posts", :action => "edit", :id => 5, :foo => "bar")
=> "/posts/edit/5?foo=bar"

# Generates a named route...
>> merb.url(:edit_post, 5)
=> "/posts/5/edit"

# Uh oh! Why can't I add query params to my named route?
# Was expecting it to generate /posts/5/edit?foo=bar
>> merb.url(:edit_post, 5, :foo => "bar")
ArgumentError: wrong number of arguments (3 for 2)
	from (irb):13:in `url'
	from (irb):13

Comments and changes to this ticket

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 »

Shared Ticket Bins