提示信息是: The action 'show' could not be found for CommentsController
下面是 Comments 代码
class CommentsController < ApplicationController
http_basic_authenticate_with :name => "admin", :password =>"password" , :only => :destroy
def create @post = Post.find(params[:post_id]) @comment = @post.comments.create(params[:comment]) redirect_to post_path(@post) end
def destroy @url = @post = Post.find(params[:post_id]) @comment = @post.comments.find(params[:id]) @comment.destroy redirect_to post_path(@url) end
end