Iはapp/views/layouts/application.html.erb
でレール3にレール2からルーティングレール3ルーティング:非CRUDコントローラ
変換してヘルプのビットを必要とする、私は:
<%= link_to "Reports", reports_path %><br>
ReportsController
があり、そしてapp/views/reports/index.html.erb
で、私はこれを持っている:
<%= link_to "Clients With Animals", :action => "getAnimals", :controller => "clients" %>
次に、設定/ routes.rbをして、私はこの(Railsの3)
match '/reports' => "reports#index"
match '/clients/getAnimals', to: "clients#getAnimals"
私はレポートのページの「getAnimals」リンクをクリックしたとき、私はこのエラーを取得:
ActiveRecord::RecordNotFound in ClientsController#show
Couldn't find Client with id=getAnimals
私は「getAnimalsは」IDにしたくない - 私はそれが行動になりたいです代わりに。
どうすればよいですか?
*あなたがroutes.rb' 'を持っているん*他に何が? URLにマッチする*/clients/getAnimalsの一致するものが*前にありますか?クライアントリソースなどと同様? –