Hi, I am getting some error which I am clue less. I try to pass more than one parameter with redirect_to, For example, My params are... search => {"name"=>"", "bus_group"=>"1", "region"=>"", "unapproved"=>"", "tech_owner"=>""} And I try to give. redirect_to params[:search].merge! (:action => ''list'') After executing this if I see in log file its showing like {"bus_group"=>nil, "name"=>"", "amp;region"=>nil, "amp;tech_owner"=>nil, "region"=>"", "amp"=>"", "action"=>"list", "amp;name"=>nil, "controller"=>"tech_projects", "amp;unapproved"=>nil, "unapproved"=>"", "tech_owner"=>""} I am confused why this "amp;" generally "&" will be parameter separator but one parameter itself called "amp;".also every params are available twice. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Is there any other solution to solve this situation?? Selva Raj wrote:> Hi, >> My params are... > search => {"name"=>"", "bus_group"=>"1", "region"=>"", "unapproved"=>"", > "tech_owner"=>""}> redirect_to params[:search].merge! (:action => ''list'')> {"bus_group"=>nil, "name"=>"", "amp;region"=>nil, "amp;tech_owner"=>nil, > "region"=>"", "amp"=>"", "action"=>"list", "amp;name"=>nil, > "controller"=>"tech_projects", "amp;unapproved"=>nil, "unapproved"=>"", > "tech_owner"=>""} >-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks James, But its not working, I am using redirect_to in rjs. If I use "update", that RJS itself not working. Regards Selvaraj.S Mark Reginald James wrote:> Selva Raj wrote: >> >> but one parameter itself called "amp;".also every params are available >> twice. > > Mmmm, try redirect_to {:action => :list}.update(params[:search]) > > -- > Rails Wheels - Find Plugins, List & Sell Plugins - > http://railswheels.com-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I use something like this to pass extra params on restful routes. Notice the extra params inside the {}. redirect_to user_path(@user, {:params1 => 1, :params2 => 2}) Hope it helps, Elioncho On Oct 27, 2:29 am, Selva Raj <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Thanks James, > > But its not working, I am using redirect_to in rjs. > > If I use "update", that RJS itself not working. > > Regards > Selvaraj.S > > Mark Reginald James wrote: > > Selva Raj wrote: > > >> but one parameter itself called "amp;".also every params are available > >> twice. > > > Mmmm, try redirect_to {:action => :list}.update(params[:search]) > > > -- > > Rails Wheels - Find Plugins, List & Sell Plugins - > >http://railswheels.com > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Whenever you pass more than one parameter in an rjs using redirect_to then it always adds & in the beginning of parameters after the first one. I had this issue as well in the past and after spending hours to fix it, I ended up using only redirect_to instead of redirect_to from rjs (basically I couldn''t sort it out). My guess is that, & is added by prototype somehow. On Oct 27, 7:43 am, elioncho <elion...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I use something like this to pass extra params on restful routes. > Notice the extra params inside the {}. > > redirect_to user_path(@user, {:params1 => 1, :params2 => 2}) > > Hope it helps, > > Elioncho > > On Oct 27, 2:29 am, Selva Raj <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Thanks James, > > > But its not working, I am using redirect_to in rjs. > > > If I use "update", that RJS itself not working. > > > Regards > > Selvaraj.S > > > Mark Reginald James wrote: > > > Selva Raj wrote: > > > >> but one parameter itself called "amp;".also every params are available > > >> twice. > > > > Mmmm, try redirect_to {:action => :list}.update(params[:search]) > > > > -- > > > Rails Wheels - Find Plugins, List & Sell Plugins - > > >http://railswheels.com > > > -- > > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
nas wrote:> Whenever you pass more than one parameter in an rjs using redirect_to > then it always adds & in the beginning of parameters after the > first one. I had this issue as well in the past and after spending > hours to fix it, I ended up using only redirect_to instead of > redirect_to from rjs (basically I couldn''t sort it out). > > My guess is that, & is added by prototype somehow.Try using: :escape => false as an additinal Parameter. -- Posted via http://www.ruby-forum.com/.