I have nested resources
resources :dicts do
resources :cards
end
and in my form
form_for [@dict,@card] do |f|
I have the following button:
<%= f.submit(‘LIST ALL’, url: dict_cards_path(@dict.id),
class:‘kanren_button’, name:‘list_all’, method: :get) %>
The generated HTML code is:
I would expect that clicking this button would call Card.index, but I
get instead the error message
The action ‘update’ could not be found for CardsController
It is correct that I don’t have a CardsController.update yet, but I
don’t think I should need one at this point.
The output from ‘rake routes|grep card’ looks fine for me:
dict_cards GET /dicts/:dict_id/cards(.:format)
cards#index
POST /dicts/:dict_id/cards(.:format)
cards#create
new_dict_card GET /dicts/:dict_id/cards/new(.:format) cards#new
edit_dict_card GET /dicts/:dict_id/cards/:id/edit(.:format)
cards#edit
dict_card GET /dicts/:dict_id/cards/:id(.:format)
cards#show
PATCH /dicts/:dict_id/cards/:id(.:format)
cards#update
PUT /dicts/:dict_id/cards/:id(.:format)
cards#update
DELETE /dicts/:dict_id/cards/:id(.:format)
cards#destroy
What did I do wrong?