And when I visit recipes/new in my browser and enter in values for the required fields [recipe name, grain names, grain weights] I get an error that the record can't be saved without grains:
There was an error saving your recipe: Grains can't be blank
I assumed that this was because the grains were being saved as strings instead of numbers (which is why I added the loop at line 10 in the recipe controller), but I can't tell if this is the case. In the console, when I enter a string number as the weight and try to save it, it's saved successfully (it's somehow automatically converted to a number):
When I run the feature spec
/spec/features/user_creates_recipes_spec.rb
, I get this error:And when I visit
recipes/new
in my browser and enter in values for the required fields [recipe name, grain names, grain weights] I get an error that the record can't be saved without grains:There was an error saving your recipe: Grains can't be blank
I assumed that this was because the grains were being saved as strings instead of numbers (which is why I added the loop at line 10 in the recipe controller), but I can't tell if this is the case. In the console, when I enter a string number as the weight and try to save it, it's saved successfully (it's somehow automatically converted to a number):
Any idea what's going on here?