Class: Myengine::CommentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/myengine/comments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
# File 'app/controllers/myengine/comments_controller.rb', line 5

def create
    @post = Post.find(params[:post_id])
    @comment = @post.comments.create(params[:comment])
    flash[:notice] = "Comment has been created!"
    redirect_to posts_path
end