Undefined method

undefined method `username’ for 1:Fixnum

Extracted source (around line #3):

1: <% form_tag (:action => ‘update_password’, :id => @user) do %>
2: enter old password
3: <%= password_field ‘user’, ‘username’ %>


4:
5: enter new password
6: <%= password_field ‘user’, ‘password’ %>

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

source:

<% form_tag (:action => ‘update_password’, :id => @user) do %>
enter old password
<%= password_field ‘user’, ‘username’ %>

enter new password
<%= password_field ‘user’, ‘password’ %>

enter confirm password
<%= password_field ‘user’, ‘new_password’ %>


<%= submit_tag “Submit” %>

<% end %>

thanks,
karthik

On 12 Sep 2008, at 10:35, karthik reva wrote:

6: <%= password_field ‘user’, ‘password’ %>

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