Skip to content

Instantly share code, notes, and snippets.

@dalizard
Created December 8, 2010 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dalizard/733246 to your computer and use it in GitHub Desktop.
Save dalizard/733246 to your computer and use it in GitHub Desktop.
def create
@comment = @article.comments.create(params[:comment])
if @comment.save
redirect_to @article, :notice => 'Thanks for your comment'
else
@comment.destroy
render "articles/show"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment