新しいアクションを作りたくて、それを「showemployees」と呼んでいます。それは私がすでにやったことです:
-> コントローラーで:
def showemployees
end
-> app/views/employees/showemployees.html.erb の作成
-> config/routes で
match "/employees/showemployees" => "employees#showemployees"
localhost:3000/employees/showemployees経由で showemployees.html.erb を開くにはこれで十分だと思いましたが、Rails は引き続き show アクション (リソース :employees から) をルーティングし、showemployees アクションを実行しないようです。教えてくれるから
ActiveRecord::RecordNotFound in EmployeesController#show
Couldn't find Employee with ID=showemployees
Rails が showemployees アクションを実行するには、何を変更する必要がありますか?
私のルートのソースコード:
System::Application.routes.draw do
match "/employees/showemployees" => "employees#showemployees" #für showemployees.html.erb
root :to => "employees#index"
resources :course_to_dos
resources :current_qualifications
resources :expected_qualifications
resources :skills
resources :employees
resources :positions
resources :admin
end