My view:
<%= form_for @product %>
<%= form.text_area :hi %>
<% end %>
My model:
def hi
'hello'
end
Which works properly from console - no matter what :hi attribute really is in the database, it's retrieved as 'hello'.
I guess Rails ignores model method overrides when autopopulating forms? How do I make it pay attention to my override?
Aucun commentaire:
Enregistrer un commentaire