How do I access this parameter?

Hi,

I have a form for creating users …

<% form_tag ‘userconfirm’ do -%>

Username
<%= text_field 'user', 'login' %>

Password
<%= password_field 'user', 'password' %>

Confirm Password
<%= password_field 'user', 'password_confirmation' %>

<% end -%>

My question is, on the controller end, how do I access the parameter
for login and password? I thought it would be params[:login] and
params[:password], but that is not right. Any help is appreciated, -
Dave

My code now:

    def userconfirm
            @user = User.new(params[:user])
            if @user.save
                    # Create session
                    if (log_user_in(params[:login],

params[:password], nil))
redirect_to :controller =>
‘order’, :action => ‘new’
else
flash[:notice] = “You are not logged
in.”
redirect_to :action => “start”
end
else
render :action => ‘userinfo’
end
end

On 14 Feb 2008, at 17:19, [email protected] wrote:

Password
<%= password_field 'user', 'password' %>

Confirm Password
<%= password_field 'user', 'password_confirmation' %>

<% end -%>

Just take a look in your log files and you’ll see that they arrive as
params[:user][:login], params[:user][:password]

Fred

Add the following if you are unsure in the controller method of
interest:

puts params.inspect

it will dump the values to the console as another option to check…

Thanks for your help. It was indeed params[:user][:login]. I didn’t
know I could use the log file so I’m grateful also for that info, -
Dave

On Feb 14, 11:35 am, Frederick C. [email protected]

If you are using rails 2, you can also use the debugger which is a TON
of
help. start script/server with --debugger and put “debugger” on the
line
you want it to stop on. Then you can inspect variables, step, and even
evaluate routines. WAY cool!!

–Alan

On Thu, Feb 14, 2008 at 1:10 PM, [email protected] <