wiz561-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-08 21:58 UTC
Passing variables from View to Controller
Hi! I was wondering if somebody would be able to help me out here for a second. I would like to pass a variable from the view into the controller. An example would look like this.... <%= text_area ''business'', ''acceptinfo'' %> How would I be able to get the controller to read what the user puts into the text area? 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-/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 -~----------~----~----~----~------~----~------~--~---
wiz561-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hi! > > I was wondering if somebody would be able to help me out here for a > second. I would like to pass a variable from the view into the > controller. An example would look like this.... > > > <%= text_area ''business'', ''acceptinfo'' %> > > > How would I be able to get the controller to read what the user puts > into the text area?It''ll be in the params hash. -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
wiz561-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-08 23:58 UTC
Re: Passing variables from View to Controller
Thank you for the response. So, for example, it would be... params[:business.acceptinfo] or something like that? I thought I tried it but I''ll give it another shot. I''m not in front of the box right now...but I''ll try it later on. Thanks! Mike On Aug 8, 5:13 pm, Michael Wang <rails-u...-JtyympAsP2K7zZZRDBGcUA@public.gmane.org> wrote:> wiz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hi! > > > I was wondering if somebody would be able to help me out here for a > > second. I would like to pass a variable from the view into the > > controller. An example would look like this.... > > > <%= text_area ''business'', ''acceptinfo'' %> > > > How would I be able to get the controller to read what the user puts > > into the text area? > > It''ll be in the params hash. > > -- > Michael Wang--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
wiz561-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Thank you for the response. > > So, for example, it would be... > > params[:business.acceptinfo] > > or something like that? I thought I tried it but I''ll give it another > shot. I''m not in front of the box right now...but I''ll try it later > on.It would be: params[:business][:acceptinfo] -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---