-3
特定のコメントを表示するだけのビューファイルであるshow.html.erbに行きたいと思います。コメントは記事の下に関連付けられています。あなたのroutes
あなたパットで関連オブジェクトのIDを渡してlink_toヘルパーを使用するにはどうすればよいですか?
# commentcontroller
def show
@article =Article.find(params[:id])
end
周囲のコード、問題の複製方法、問題を解決するために何を試みたのかを人々が理解できるよう、いくつかの情報を追加してください。また、適切なマークアップを使用して質問内のコードの書式を設定します。 –
プロジェクトのルートで 'rake routes'を実行して私たちを見せてもらえますか? –
プレフィックス動詞URIパターンコントローラ#アクションarticle_comments GET/articles /:article_id/comments comments#index POST/articles /:article_id/comments comments#create new_article_comment GET/articles /:article_id/comments/new comments#new article_comment GET /記事#:/ article_id/comments /:idコメント#PATCH /articles/:article_id/comments/:id(.:format)コメント#アップデートPUT /articles/:article_id/comments/:id(.:format)comments#update DELETE /articles/:article_id/comments/:id(.:format) –