Created
December 29, 2017 09:11
-
-
Save PrimeTimeTran/7d7c5c2c5828d2aeee4e07f4b123ede7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 = current_user.comments.create!(comment_params) | |
@parent = params[:comment][:parent_id] | |
PostMailer.commented_post(@comment.post.user_id, current_user).deliver_now unless Post.mine?(@comment.post.id, current_user) | |
Rb::PhotoUploadService.upload(current_user.id, self.class, @comment.id, params[:comment][:photo]) if params[:comment][:photo] | |
respond_to do |format| | |
if @comment.save | |
format.html { redirect_back(fallback_location: root_path) } | |
format.js | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment