私はレールアプリケーションを開発中で、このような問題が発生しました。Railsのルート設定は、アクションメソッドがオブジェクトIDであると考えます
私は定義されたこれらのアクションとルートを持っているmovies_controller.rb
、持っている:
Prefix Verb URI Pattern Controller#Action
movies GET /movies(.:format) movies#index
POST /movies(.:format) movies#create
new_movie GET /movies/new(.:format) movies#new
edit_movie GET /movies/:id/edit(.:format) movies#edit
movie GET /movies/:id(.:format) movies#show
PATCH /movies/:id(.:format) movies#update
PUT /movies/:id(.:format) movies#update
DELETE /movies/:id(.:format) movies#destroy
root GET / redirect(301, /movies)
movies_by_director GET /movies/by_director(.:format) movies#by_director
をしかし、私は/movies/by_director?director="something"
へ行くしようとすると、レールは、私は、パラメータ:id = by_director
でmovies#show
アクションに移動してることを、考えます。
私は間違っていますか?
:)ありがとう! –