Permalink
Browse files

Add Create method for comments

  • Loading branch information...
1 parent 438302a commit d8c3148b2c22bf0dcebd0b662513966f781f3bff @yannr77 committed Jan 27, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 app/controllers/comments_controller.rb
@@ -1,2 +1,7 @@
class CommentsController < ApplicationController
+ def create
+ @post = Post.find(params[:post_id])
+ @comment = @post.comments.create(params[:comment])
+ redirect_to post_path(@post)
+ end
end

0 comments on commit d8c3148

Please sign in to comment.