In the following tutorial: http://asciicasts.com/episodes/160-authlogic It has this in the controller: @user = User.new(params[:user]) I get that we are creating here a new object of User class. But, what is the :user parameter here denoting to? Thanks. -- 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.
On 18 July 2010 16:21, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> In the following tutorial: http://asciicasts.com/episodes/160-authlogic > > It has this in the controller: @user = User.new(params[:user]) > > I get that we are creating here a new object of User class. But, what is > the :user parameter here denoting to?Please see my comment on your other post that you work through the Rails Guides. Then all will become clear (well less muddy anyway). Colin -- 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.
When creating a new user the data (name, email, password, etc) will be sent inside a hash. The "params[:user]" it''s letting it know that it needs to create a new user from the parameters that come from the "user" hash. On Jul 18, 10:48 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 18 July 2010 16:21, Abder-Rahman Ali <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > In the following tutorial:http://asciicasts.com/episodes/160-authlogic > > > It has this in the controller: @user = User.new(params[:user]) > > > I get that we are creating here a new object of User class. But, what is > > the :user parameter here denoting to? > > Please see my comment on your other post that you work through the > Rails Guides. Then all will become clear (well less muddy anyway). > > Colin-- 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.
Carlos Cabrera wrote:> When creating a new user the data (name, email, password, etc) will be > sent inside a hash. The "params[:user]" it''s letting it know that it > needs to create a new user from the parameters that come from the > "user" hash.Thanks Carlos. Nice clarification. -- 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.