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

@@ -7,6 +7,7 @@
<%= f.hidden_field :commentable_type, value: commentable.class.name %>
<%= f.hidden_field :commentable_id, value: commentable.id %>
<%= f.hidden_field :parent_id, value: parent_id %>
<%= f.hidden_field :valuation, value: local_assigns.fetch(:valuation, false) %>
<%= f.submit comment_button_text(parent_id, commentable), class: "button", id: "publish_comment" %>