ruby on rails - Setting attribute equal to another -
so have inventory application api. under specific circumstance need raise unit_price of inventory $10. have named circumstance have set condition either 0 or 10 , variable saved in attribute y factor. testing purposes have set yfactor 10.
def price inventory.unit_price= inventory.unit_price + yfactor.to_f respond_to |format| format.json{render} end end
i undefined method (unit_price) error.
using rails 4.
Comments
Post a Comment