I have a small testing RailsApp with a simple model, which has a float
attribute called price:
In the model I have overridden the price() method:
class Product < ActiveRecord::Base
In the console, it behaves as expected:
p = Product.new
p.price = 12.12
However, Using the form helper methods, it appears they are not using
the instance methods:
<%= form.text_field :price %>
displays: 12.12 in my view, and ignores the overridden AR instance
Why do the form_helpers work this way?
Is this a bug? Or is this approach chosen on purpose?
Harm de Laat