Hi,
I''m trying to modify an AR model''s foo attribute before
reading into
the model''s edit form. I''ve tried the following:
class Model
def foo
"the foo attribute is " + read_attribute(:foo)
end
end
If I use a form_for on the edit view with the following code, I get
the plain database value inside the text field and the AR value next
to it:
<% form_for(@model) do |f| %>
<%= f.text_field, :foo %> <%= @model.foo %>
<% end %>
It seems like they should show the same value but they don''t. What am
I missing?
Thanks,
Harry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---