<%= link_to t('.new', :default => t("helpers.links.new")), new_equipment_path, :class => 'btn btn-primary' %>
我在视图中有上面的代码,但是在单击链接时出现以下错误:No route matches {:action=>"show", :controller=>"equipment"}
我的路线文件包含:
resources :equipment
resources :workouts
match ':controller(/:action(/:id))(.:format)'
为什么要尝试访问 show 操作?
以下是我的路线中的条目:
equipment_index GET /equipment(.:format) equipment#index
POST /equipment(.:format) equipment#create
new_equipment GET /equipment/new(.:format) equipment#new
edit_equipment GET /equipment/:id/edit(.:format) equipment#edit
equipment GET /equipment/:id(.:format) equipment#show
PUT /equipment/:id(.:format) equipment#update
DELETE /equipment/:id(.:format) equipment#destroy