foreverman
2012-Apr-13 06:00 UTC
how to add a query parameter with same name as one of the options in url_for helper
Hey, I upgraded our app from rails 3.0.10 to rails 3.1, but I found that the helper call ''sites_path(@site, :domain => a_domain)'' won''t generate the url I want, I actually want something like ''/sites/1? domain=a_domain'', but query parameter ''domain'' is missing from the generated url. I found that Rails 3.1 introduced a new option called ''domain'' for url_for: http://guides.rubyonrails.org/3_1_release_notes.html#action-dispatch. I am curious if we can still add query parameter called ''domain'' in url. Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2012-Apr-13 13:58 UTC
Re: how to add a query parameter with same name as one of the options in url_for helper
On Apr 13, 2012, at 2:00 AM, foreverman wrote:> Hey, > > I upgraded our app from rails 3.0.10 to rails 3.1, but I found that > the helper call ''sites_path(@site, :domain => a_domain)'' won''t > generate the url I want, I actually want something like ''/sites/1? > domain=a_domain'', but query parameter ''domain'' is missing from the > generated > url. I found that Rails 3.1 introduced a new option called ''domain'' > for url_for: http://guides.rubyonrails.org/3_1_release_notes.html#action-dispatch. > I am curious if we can still add query parameter called ''domain'' in > url.I''m not sure this will help, there may be some coercion going on further up the chain that you''d be hard-pressed to override, but you might try using a bare string instead of the symbol: ''domain'' => ''a_domain''. Walter> > Thanks. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.