-1
このRailsアプリでは、ユーザーはストーリーを書く。ストーリーはコレクションの一部である場合があります。コレクションは、コレクションを作成したユーザーに属します。各doループのLink_toパスが機能しない
私は、それが含まれているコレクションへのリンクを含む単一のストーリーを表示しようとしています。 collection.nameの部分は動作しますが、私はcollection_pathの権利を取得できません。ご協力いただきありがとうございます。
の物語/ show.html.erbコレクションの助けを借りて、以下を使用して、それを解決
user_collections GET /users/:user_id/collections(.:format) collections#index
POST /users/:user_id/collections(.:format) collections#create
new_user_collection GET /users/:user_id/collections/new(.:format) collections#new
edit_user_collection GET /users/:user_id/collections/:id/edit(.:format) collections#edit
user_collection GET /users/:user_id/collections/:id(.:format) collections#show
routes.rbを
resources :users do
resources :collections