Skip to content

Instantly share code, notes, and snippets.

@bokmann
Created March 4, 2010 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bokmann/321287 to your computer and use it in GitHub Desktop.
Save bokmann/321287 to your computer and use it in GitHub Desktop.
def create
unless @commentable.nil?
@comment = @commentable.comments.create!(params[:comment])
respond_to do |format|
format.html { redirect_to @commentable }
format.json { @commentable.to_json }
format.partial { render :partial => "comments/comment.html.erb",
:object => @comment,
:layout => false }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment