Allow valuation internal comments to be created

How:

Using a local variable at partials to set a hidden true/false value for
`valuation` parameter on the comment creation form.

Allowing that new param at the comment controller and using it when
building a new Comment.
This commit is contained in:
Bertocq
2018-01-29 22:14:03 +01:00
parent dff966d9b3
commit 149c81371b
9 changed files with 41 additions and 19 deletions

View File

@@ -45,12 +45,13 @@ class CommentsController < ApplicationController
def comment_params
params.require(:comment).permit(:commentable_type, :commentable_id, :parent_id,
:body, :as_moderator, :as_administrator)
:body, :as_moderator, :as_administrator, :valuation)
end
def build_comment
@comment = Comment.build(@commentable, current_user, comment_params[:body],
comment_params[:parent_id].presence)
comment_params[:parent_id].presence,
comment_params[:valuation])
check_for_special_comments
end