ネスト外のresources
<修正前>
routes.rb
constraints host: config[:admin][:host] do
namespace :admin, path: config[:admin][:path] do
root "top#index"
get "login" => "sessions#new", as: :login
resource :session,only:[:create,:destroy]
resources :staff_members do
resources :staff_events, only: [ :index ]
end
end
end
:admin_staff_eventsのprefixが生成されていないことを疑いました。モデル等を調べても問題なさそう。
ルーティングにおいてネストされたresources以外にも:staff_eventsが必要だと判明。
<修正後>
routes.rb
constraints host: config[:admin][:host] do
namespace :admin, path: config[:admin][:path] do
root "top#index"
get "login" => "sessions#new", as: :login
resource :session,only:[:create,:destroy]
resources :staff_members do
resources :staff_events, only: [ :index ]
end
resources :staff_events, only: [ :index] #<=ここを追記
end
end
無事に表示されました。
Author And Source
この問題について(ネスト外のresources), 我々は、より多くの情報をここで見つけました https://qiita.com/yun02850266/items/50914686be85cece1726著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .