0

I'm using the money-rails gem for one of my Models to store the cost of manufacture.

In my model I have -

monetize :cost_of_manufacturing_cents

And in the _form.html view I have for simple_form :

f.input :cost_of_manufacturing

However, when I run the item/new route, I get the following error

undefined method `cost_of_manufacturing' for #<Item:0x007fe34a5feaf8>

How can I resolve this issue?

Michael Victor
  • 861
  • 2
  • 18
  • 42
  • Obvious stuff but, did you run the migration and restart the server? Does it work in the console, if you run rails s, then i = Item.new, i.cost_of_manufacturing ?? – rlarcombe Nov 16 '15 at 17:20
  • I did. When I run i.cost_of_manufacturing, I get this error NoMethodError: undefined method `cost_of_manufacturing' for # – Michael Victor Nov 16 '15 at 17:24
  • I think I got the problem, there was an issue with my initializer file. Thanks for taking the time! – Michael Victor Nov 16 '15 at 17:32

0 Answers0