@user = User.new(params[:user])

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.

On 18 July 2010 16:21, Abder-Rahman A. [email protected] 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

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.

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.