Sha256: 4d4f9fdbcdafd5c46adf9a1214daeab92c13d8e357989e385db5d9d7b9968e76
Contents?: true
Size: 286 Bytes
Versions: 3
Compression:
Stored size: 286 Bytes
Contents
class CommentsController < ApplicationController def create @post = Post.find(params[:post_id]) @comment = @post.comments.build(params[:comment]) flash[:alert] = 'Fail to receive the comment. Double check the fields' unless @comment.save redirect_to @post end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
blogmodule-1.0.2 | app/controllers/comments_controller.rb |
blogmodule-1.0.1 | app/controllers/comments_controller.rb |
blogmodule-1.0.0 | app/controllers/comments_controller.rb |