Created
October 24, 2011 20:53
-
-
Save JakeAustwick/1310247 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
class CommentsController < ApplicationController | |
def create | |
picture = Picture.find(params[:picture_id]) | |
@comment = picture.comments.new(params[:comment]) | |
if @comment.save | |
flash[:success] = "Your comment has been added." | |
redirect_to picture_path(picture) | |
return | |
else | |
@title = "Gallery Detail" | |
render :new | |
end | |
end | |
def new | |
@comment = Comment.new | |
@title = "Comment Errors" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment