Consider link = url_for(:controller => "signed_in", :action => "show", :id => "user_info") # => /signed_in/user_info to which I wish to add the either or both of the following locale=en nickname=ralph Is there a nice way in Rails or Ruby to do this so that I end up with /signed_in/user_info?locale=en&nickname=ralph or /signed_in/user_info?locale=en or /signed_in/user_info?nickname=ralph but not /signed_in/user_info?locale=en?nickname=ralph ? -- Posted via http://www.ruby-forum.com/. -- 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.
> Consider > > link = url_for(:controller => "signed_in", > :action => "show", :id => "user_info") > # => /signed_in/user_info > > to which I wish to add the either or both of the following > > locale=en > nickname=ralph > > Is there a nice way in Rails or Ruby to do this so that I end up with > /signed_in/user_info?locale=en&nickname=ralph > or > /signed_in/user_info?locale=en > or > /signed_in/user_info?nickname=ralph > but not > /signed_in/user_info?locale=en?nickname=ralph > ?link = url_for(:controller => "signed_in", :action => "show", :id => "user_info" :locale => "en", :nickname => "ralph") -philip -- 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.
On 17 February 2010 00:28, Philip Hallstrom <philip-LSG90OXdqQE@public.gmane.org> wrote:>> Consider >> >> link = url_for(:controller => "signed_in", >> :action => "show", :id => "user_info") >> # => /signed_in/user_info >> >> to which I wish to add the either or both of the following >> >> locale=en >> nickname=ralph >> >> Is there a nice way in Rails or Ruby to do this so that I end up with >> /signed_in/user_info?locale=en&nickname=ralph >> or >> /signed_in/user_info?locale=en >> or >> /signed_in/user_info?nickname=ralph >> but not >> /signed_in/user_info?locale=en?nickname=ralph >> ? > > link = url_for(:controller => "signed_in", > :action => "show", :id => "user_info"There should be a comma on the end of line above of course. Colin> :locale => "en", :nickname => "ralph") > > -philip > > -- > 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.