-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take Hash with options inside Array in #url_for #9599
Conversation
cc @drogus |
Needs tests and a changelog entry. |
great patch 👍 looking forward to it! |
/cc @bjoernbur |
thanks for this patch... |
I'm done with tests and a changelog entry. |
|
||
controller = kls.new | ||
assert_equal("http://www.basecamphq.com/admin/posts/new?param=value", | ||
controller.send(:url_for, [:new, :admin, :post, { :param => 'value' }]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 1.9 style hash.
Done. |
+1 for the behaviour, but why |
@egilburg there are a lot of Look, polymorphic helpers already have this functionality, you can path url options as the second param (as I do with You can use it like I hope I've cleared this. |
@egilburg doing it in @josevalim are you still 👎 on this behavior ? |
@josevalim ping |
@senny ping |
@ognevsky we need to wait for @josevalim to jump in. |
@senny ok, let's wait. |
The issue here is what is going to be considered the form object in form_for if the last element is a hash. Can a hash be a form object today? If so, how this patch affect |
@ognevsky if you can add tests for |
@josevalim @pixeltrix sorry for the long wait. Jose, this patch doesn't affect to So, I don't change |
@josevalim @pixeltrix I've rebased and updated this request. |
@ognevsky Looks like there's failure https://travis-ci.org/rails/rails/jobs/13876911#L3127 |
@chancancode oops, I'll fix it in the morning |
Fixed. I've added this failing spec to the commit accidentally, it should never pass (because |
@ognevsky can you add a CHANGELOG entry and squash your commits - then I'll merge it. |
@pixeltrix I'm ready |
Take Hash with options inside Array in #url_for
@ognevsky thanks! |
You da man! |
Allows you to code like this: