Hi I want to pass two set of values when a particular check box is checked for eg. If I have name and email address. how should I write the view code if in my controller I want the name and email address accessible from my params hash.. regards, warlock -- 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 -~----------~----~----~----~------~----~------~--~---
Vinay Beckham wrote:> Hi > I want to pass two set of values when a particular check box is checked >h> for eg.> If I have name and email address. > how should I write the view code > if in my controller I want the name and email address accessible from my > params hash.. > > regards, > warlocknot sure about the specifics of a check box but you can just extra params after you for eg your action/controller. for example: <%= link_to_remote "Link name", :url=>{:controller=> "profile", :action=>"index", :email=>@email,:name=>@name}%> then in your controller you can access the @email and @name as params def index @email = params[:email] @name = params[:name] end i''ve never used a checkbox in this way but I think this is the general idea. hope it helps. -- 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 -~----------~----~----~----~------~----~------~--~---
ohhhh ok .. got it... i will try some RnD on this... will reply if i get any other better way to do this... Phil Tayo wrote:> not sure about the specifics of a check box but you can just extra > params after you for eg your action/controller. > > for example: > > <%= link_to_remote "Link name", :url=>{:controller=> "profile", > :action=>"index", :email=>@email,:name=>@name}%> > > then in your controller you can access the @email and @name as params > > def index > @email = params[:email] > @name = params[:name] > end > > i''ve never used a checkbox in this way but I think this is the general > idea. hope it helps.-- 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 -~----------~----~----~----~------~----~------~--~---