I am trying to call a controller method from my view, but I get an error
and I don’t know how to correct it.
What i am trying to do:
I am in the edit form of the model Product, and products can have many
ingredients. So on my edit form there is a text_field where you type the
ingredient with a link “Add” which is supposed to add the typed
ingredient to the current ingredients list.
this is how i try to call my controller method:
<%=link_to “Add”,:action => :add_ingredient,:id => @product %>
This is my method in the controller:
@product = Product.find(params[:id])
No action responded to 30. Actions: add_ingredient, create, destroy,
edit, index, new, show, and update