I have an ''edit_user'' template that looks like this:
<% form_for :user, @user, :url => { :action =>
''edit_user'' } do |f|
%>
<p>
<label for="user_name">User Name:</label>
<%= f.text_field :name %>
<p>
<label for="user_fullname">Full Name:</label>
<%= f.text_field :fullname %>
</p>
<p>
<label for="user_password">Password:</label>
<%= f.text_field :password %>
</p>
<p>
<label
for="user_password_confirmation">Confirm:</label>
<%= f.text_field :password_confirmation %>
</p>
<p>
<label for="user_role">User Role:</label>
<%= select_tag "user[role]", @options %>
</p>
<%= submit_tag "Save Changes", :class =>
"submit" %>
<% end %>
The problem is that it never displays existing data for the password and
password_confirmation attributes. Password is a virtual attribute that
actually points to a hashed_password in the db, as shown in the AWDWR
book.
This makes things difficult, because if I want to edit a user, I have to
know their existing password.
How do I get a virtual attribute to place it''s value in the above
:password and :password_confirmation boxes?
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---