我不断收到这些错误,因为“编辑”操作没有路线匹配
控制器:
def remove_artifact_from_collection
... do my stuff ..
render(:action=>:show)
end
视图:错误所在的行
<p><%= link_to 'Edit Evidence Item', edit_artifact_path, :class => 'edit_button' %></p>
路线:
resources :artifacts do
collection do
get 'remove_artifact_from_collection'
end
end
bundle exec rake 路由
remove_artifact_from_collection_artifacts GET /artifacts/remove_artifact_from_collection(.:format) {:controller=>"artifacts", :action=>"remove_artifact_from_collection"}
artifacts GET /artifacts(.:format) {:controller=>"artifacts", :action=>"index"}
POST /artifacts(.:format) {:controller=>"artifacts", :action=>"create"}
new_artifact GET /artifacts/new(.:format) {:controller=>"artifacts", :action=>"new"}
edit_artifact GET /artifacts/:id/edit(.:format) {:controller=>"artifacts", :action=>"edit"}
artifact GET /artifacts/:id(.:format) {:controller=>"artifacts", :action=>"show"}
PUT /artifacts/:id(.:format) {:controller=>"artifacts", :action=>"update"}
DELETE /artifacts/:id(.:format) {:controller=>"artifacts", :action=>"destroy"}