I have controller vegetable. It has standart new and create methods.
I want to create potato action, that contain form and using vegetable's create method.
In potato view i have this:
= form_for @vegetable, :url => '/vegetable/create/' do |f|
= f.text_field :color
= f.submit "Save"
When i press save, i get error
ActiveRecord::RecordNotFound in VegetablesController#update
Couldn't 开发者_如何转开发find Vegetable with ID=create
It uses update
, not create
method. How can i say Rails to send form to create
action?
you sould use corresponded :url => vegetable_path
精彩评论