head 1.8; access ; symbols ; locks ;comment @@; 1.8 date 2014.11.12.11.17.26; author p4; state Exp; branches ; next 1.6; 1.6 date 2014.11.12.10.08.58; author p4; state Exp; branches ; next ; desc @@ 1.8 log @@ text @class CommentsController < ApplicationController def new @@comment = Comment.new end def create @@article = Article.find(params[:article_id]) @@comment = @@article.comments.new(:article_id => params[:article_id], :comment => params[:comment][:comment]) if @@comment.save flash[:success] = "Thanks for commenting" + comments_params.to_s redirect_to articles_path(:sort=>params[:sort]) else flash[:error] = "Oops, didn't quite pan out" render :new end end def comments_params params.require(:comment).permit(:article_id,:comment) end end @ 1.6 log @@ text @d10 1 a10 1 flash[:success] = "Thanks for commenting" d18 3 @