Hi all,
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
def price
return "bla"
end
end
In the console, it behaves as expected:
p = Product.new
p.price = 12.12
p.price
>> "bla"
However, Using the form helper methods, it appears they are not using
the instance methods:
for instance:
<%= form.text_field :price %>
displays: 12.12 in my view, and ignores the overridden AR instance
method.
Why do the form_helpers work this way?
Is this a bug? Or is this approach chosen on purpose?
Regards,
Harm de Laat
Kabisa ICT
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---