Sha256: 388fa6f7a4138c59028f59346099cfe074251ef51c3e63ce2462747388e83d99
Contents?: true
Size: 470 Bytes
Versions: 4
Compression:
Stored size: 470 Bytes
Contents
class CommentsController < ApplicationController http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy def create @post = Post.find(params[:post_id]) @comment = @post.comments.create(params[:comment].permit(:commenter, :body)) 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
Version data entries
4 entries across 4 versions & 2 rubygems