使用money_column寶石我是小白的軌道...使用Rails 3.1與軌道
我試圖使用money_column gem。我安裝了gem,添加到我的gemfile,捆綁安裝。我設置了一個像示例一樣的產品模型。
我的產品型號是:
class Product < ActiveRecord::Base
belongs_to :product_category
attr_accessible :sku, :name, :description, :price, :available, :product_category_id
money_column :price
end
我在seeds.rb創建了一些種子數據。但是,當我運行rake db:seed時,出現錯誤:
rake aborted!
undefined method `money_column' for #<Class:0x007fccbd26e468>
我在安裝money_column時錯過了什麼嗎?
我會建議看看錢寶石。它處理金錢,貨幣和交換*非常*好。 https://github.com/RubyMoney/money –