我正在使用 Rails 3.2.5。遵循 Ryan Bates 教程。
http://railscasts.com/episodes/145-integrating-active-merchant。我的 order.rb 有这个功能
def purchase
response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)
transactions.create!(:action => "purchase", :amount => price_in_cents, :response => response)
cart.update_attribute(:purchased_at, Time.now) if response.success?
response.success?
end
由于 rails 3.2.5 使用 MassAssignmentSecurity。我收到以下错误。
Can't mass-assign protected attributes: action, amount, response
我尝试将它们添加到 attr_accessible 列表中,但没有运气。我如何将它们添加到列表中或至少覆盖它们?