François Beausoleil
2007-Apr-03 21:20 UTC
Nested hash parameters do not work with #link_to
Hi all, Is it me or should this work: <%= link_to("link", :a => {:b => 1}) %> I expected: ?a[b]=1 But instead I get: ?a=b1 b1 is the #to_s form of {:b => 1}. So, are my expectations wrong, or am I right ? If I'm right, where should I look at to patch Rails ? Just a general pointer would be appreciated. Thanks ! -- François Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2007-Apr-04 08:14 UTC
Re: Nested hash parameters do not work with #link_to
On 4/3/07, François Beausoleil <francois.beausoleil@gmail.com> wrote:> > Is it me or should this work: > > <%= link_to("link", :a => {:b => 1}) %> > > I expected: ?a[b]=1 > > But instead I get: ?a=b1I tried it on edge Rails. I get what you expected: ActionController::Routing::Routes.generate({:a => {:b=>1}}, {:controller=>'con', :action=>'act'}) #=> "/con/act?a[b]=1" See relevant tests: http://dev.rubyonrails.org/browser/trunk/actionpack/test/controller/url_rewriter_test.rb?rev=6380#L168 They were added in [6343]: http://dev.rubyonrails.org/changeset/6343 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
François Beausoleil
2007-Apr-04 19:43 UTC
Re: Nested hash parameters do not work with #link_to
Hi ! 2007/4/4, Mislav Marohnić <mislav.marohnic@gmail.com>:> I tried it on edge Rails. I get what you expected: > > ActionController::Routing::Routes.generate({:a => {:b=>1}}, > {:controller=>'con', :action=>'act'}) > #=> "/con/act?a[b]=1" > > They were added in [6343]: > http://dev.rubyonrails.org/changeset/6343Ah, I tried merging that to the 1.2 stable branch, and the patch applies cleanly except for CHANGELOG. Could somebody backport [6343] to the Rails 1.2 branch ? We took a decision early on to track 1.2 and not edge for now. Thanks ! -- François Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2007-Apr-04 19:59 UTC
Re: Nested hash parameters do not work with #link_to
On 4/4/07, François Beausoleil <francois.beausoleil@gmail.com> wrote:> > Could somebody backport [6343] to the Rails 1.2 branch ?Depends if they consider this a feature or a defect. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
François Beausoleil
2007-Apr-04 20:16 UTC
Re: Nested hash parameters do not work with #link_to
2007/4/4, Mislav Marohnić <mislav.marohnic@gmail.com>:> On 4/4/07, François Beausoleil <francois.beausoleil@gmail.com> wrote: > > Could somebody backport [6343] to the Rails 1.2 branch ? > > Depends if they consider this a feature or a defect.If it was "corrected" on trunk, I would think this is a defect that needed correcting. Also [6343] closed three tickets, which would imply this is something that needed work on. Anyway, wait and see :) Thanks ! -- François Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---