1

I need some help in figuring out how to set up a helper method and then call in in the view. What i need to do is update a single attribute of a model object.

How I plan to do this is to call a helper method Bid, which will update the attribute by the same increment every time, for example, by one dollar.

Then, I need a way to call this helper method in the view and update the auction attribute current_price and display it in the view. Any ideas on how this could be done? Thanks

4

1 回答 1

1

只需更新控制器中的价格并将Bid实例传递给视图。在视图中,您调用如下内容:

@bid.price

访问当前出价的价格。

于 2014-11-10T20:22:25.043 回答