From 15ea8fc0dc6e50fbf8f014a0c1b108ed4ff5d2ca Mon Sep 17 00:00:00 2001 From: Pavel Maslov Date: Tue, 13 Sep 2016 12:01:56 +0200 Subject: [PATCH] Bug fixed: comments in results have no error message if the text exceeds 1000 characters. --- app/controllers/result_comments_controller.rb | 2 +- app/views/result_comments/_index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/result_comments_controller.rb b/app/controllers/result_comments_controller.rb index 9ab162fe3..63d311447 100644 --- a/app/controllers/result_comments_controller.rb +++ b/app/controllers/result_comments_controller.rb @@ -86,7 +86,7 @@ class ResultCommentsController < ApplicationController format.html { render :new } format.json { render json: { - errors: @comment.errors + errors: @comment.errors.to_hash(true) } } end diff --git a/app/views/result_comments/_index.html.erb b/app/views/result_comments/_index.html.erb index c10e46e5d..6e9ec19f8 100644 --- a/app/views/result_comments/_index.html.erb +++ b/app/views/result_comments/_index.html.erb @@ -19,7 +19,7 @@

  • <%= bootstrap_form_for :comment, url: { format: :json }, method: :post, remote: true do |f| %> - <%= f.text_field :message, hide_label: true, placeholder: t("general.comment_placeholder"), append: f.submit("+", onclick: "processResult(event, ResultTypeEnum.COMMENT, false);"), help: '.' %> + <%= f.text_field :message, hide_label: true, placeholder: t("general.comment_placeholder"), append: f.submit("+"), help: '.' %> <% end %>