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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user