Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个事件控制器,其方法从注册模型payment中调用save_with_payment方法,注册模型中的方法需要获取price事件来构建支付和注册,但我如何访问价格属性?
payment
save_with_payment
price
谢谢 :)
您需要使用它公开它,attr_accessible然后您可以使用它访问它@event.price
attr_accessible
@event.price