Created
November 30, 2008 07:27
-
-
Save Oshuma/30406 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create(comment) | |
@article = Article.get(params[:article_id]) | |
@comment = Comment.new(comment.merge(:article => @article)) | |
if @comment.save | |
redirect resource(@article), :message => {:notice => 'Your comment was saved.'} | |
else | |
redirect resource(@article), :message => {:error => 'Must fill in all fields.'} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment