Displaying 1 result from an estimated 1 matches for "regular_price".
2006 Apr 05
1
number_to_currency inside model
...s is possible.
I have a model (Item) that contains products. These products have prices
that I''d like to format using number_to_currency. Rather than doing this
several times inside the view, I thought it might be nice to do it once
inside the model.
The item table has an field called regular_price which holds a currency
amount. I would like to do something like what''s below, but I get the
following error message:
undefined method `number_to_currency'' for #<Item:0x2479430>
Here is the model.
class Item < ActiveRecord::Base
has_many :item_attributes, :order =&g...