<Rails Guides>里 Destroy Comments 的问题

按照Rails Guides实现一个博客系统http://guides.ruby.tw/rails3/getting_started.html

问题是:”删除评论”模块,点击”Destroy”超链接错误:

Unknown actionThe action 'show' could not be found for CommentsController

CommentsController.rb:::

class CommentsController < ApplicationController  def create     @post = Post.find(params[:post_id])      @comment = @post.comments.create(params[:comment])    redirect_to post_path(@post)   end   def destroy      @post = Post.find(params[:post_id])      @comment = @post.comments.find(params[:id])      @comment.destroy    redirect_to post_path(@post)   end end
<Rails Guides>里 Destroy Comments 的问题

相关文章:

你感兴趣的文章:

标签云: