Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Generate URL with array notation might accept a hash to build the query string #7246

Sephi-Chan opened this Issue · 4 comments

2 participants


To build a URL like /some_objects/42?foo=bar we can not use the array notation.

<%= link_to, [ @some_object, { foo: 'bar' } ] %>

Would you Rails team be interested in such a patch to url_for ?


url_for already accepts an Array but it uses to generate the polymorphic_url like this:

polymorphic_url([:admin, blog, post]) # => ""

I have mixed felling about this. Maybe it is useful, but I only have sure seem the implementation and more examples. Please go ahead and open a pull request.


Also I think is better to send this to the Rails core mailing list. I'm closing this since it is not an issue neither a pull request and we are not using the issue tracker to feature request/suggestion.


Thanks @rafaelfranca, I'll try it and send a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.