使用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 –