hello I have problems receiving the parameter from form? <input id="user_username" name="user[username]" size="40" type="text" /> in my controller @method = @params[''user_username''] or @method @params[''user[username]''] both is not working? not receiving anything?? hope someone out their can giv a hand, and thanks :) //Jamal -- 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan wrote:> hello > > I have problems receiving the parameter from form? > > <input id="user_username" name="user[username]" size="40" type="text" /> > > in my controller > > @method = @params[''user_username''] or @method > @params[''user[username]''] > > both is not working? not receiving anything?? > > hope someone out their can giv a hand, and thanks :) > > //Jamal > >Use params[:field] instead of @params[:field] @params is the old way of doing things. Try @method = params[:user][:username] The data in the form will go into params[:user] and then you can access the individual fields if you need to though most of the time you will just be doing something like @user = User.new(params[:user]) Matt Margolis blog.mattmargolis.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matthew Margolis wrote:> Jamal Soueidan wrote: >> >> both is not working? not receiving anything?? >> >> hope someone out their can giv a hand, and thanks :) >> >> //Jamal >> >> > Use params[:field] instead of @params[:field] @params is the old way of > doing things. > > Try > @method = params[:user][:username] > > The data in the form will go into params[:user] and then you can access > the individual fields if you need to though most of the time you will > just be doing something like > @user = User.new(params[:user]) > > Matt Margolis > blog.mattmargolis.nethehehe, thats really funny you can not imagine how many things i tried.. @parameters[''user_username''] @params[:user[username]]; @params[''user''][''username''] and plenty of others, nothing work..but in the end yours worked :D and thanks for your help... and thanks for telling me about the old way :D I''m still new -- 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 -~----------~----~----~----~------~----~------~--~---