I have a situation in which I store all prices excl VAT. Now, this
module needs to have the price incl VAT. How do I do this, for example,
in the controllers I do something like
You can try defining the method in application.rb and use
before_filter macro to declare it in controllers.
Would like to know more about filters?
Refer this:
http://www.therailsway.com/2006/11/16/tracks-part-2
I found an other very interesting way to do this (although it doesn't
work yet)
just re-define the 'price' method
The question I have is: how do I create the same price method as
activeRecord.
(for testing only) For example:
def price
read_attribute(:price)
end
gives me problems (I get nil object etc), so ActiveRecord does more then
this. Furthermore, is there a way to call the original price method, I
tried something like