undefined method

undefined method `username' for 1:Fixnum

Extracted source (around line #3):

1: <% form_tag (:action => 'update_password', :id => @user) do %>
2: <label> enter old password</label>
3: <%= password_field 'user', 'username' %><p>
4:
5: <label> enter new password</label>
6: <%= password_field 'user', 'password' %><p>

I got above error run this program. please any one help me..

source:

<% form_tag (:action => 'update_password', :id => @user) do %>
<label> enter old password</label>
<%= password_field 'user', 'username' %><p>

<label> enter new password</label>
<%= password_field 'user', 'password' %><p>

<label> enter confirm password</label>
<%= password_field 'user', 'new_password' %><p>
<%= submit_tag "Submit" %>

<% end %>

thanks,
karthik

undefined method `username' for 1:Fixnum

Extracted source (around line #3):

1: <% form_tag (:action => 'update_password', :id => @user) do %>
2: <label> enter old password</label>
3: <%= password_field 'user', 'username' %><p>
4:
5: <label> enter new password</label>
6: <%= password_field 'user', 'password' %><p>

I got above error run this program. please any one help me..

Sounds like @user is the number 1 whereas rails is expecting it to be
something with a username, password and new_password methods (eg an
instance of User)

Fred