Skip to content

Instantly share code, notes, and snippets.

class CommentsController < ApplicationController
# POST /comments
# POST /comments.xml
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create(params[:comment])
respond_to do |format|
format.html { redirect_to post_path(@post) }
format.js
end