diff --git a/app/views/fluentd/settings/in_syslog/_form.html.haml b/app/views/fluentd/settings/in_syslog/_form.html.haml index 8ebf027..4c13a93 100644 --- a/app/views/fluentd/settings/in_syslog/_form.html.haml +++ b/app/views/fluentd/settings/in_syslog/_form.html.haml @@ -1,5 +1,4 @@ -- @setting.errors.full_messages.each do |msg| - = msg += render "shared/setting_errors" = form_for(@setting, url: finish_fluentd_setting_in_syslog_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f| = field(f, :tag) diff --git a/app/views/fluentd/settings/out_forward/_form.html.haml b/app/views/fluentd/settings/out_forward/_form.html.haml index 25209a4..e22b312 100644 --- a/app/views/fluentd/settings/out_forward/_form.html.haml +++ b/app/views/fluentd/settings/out_forward/_form.html.haml @@ -1,5 +1,4 @@ -- @setting.errors.full_messages.each do |msg| - = msg += render "shared/setting_errors" = form_for(@setting, url: finish_fluentd_setting_out_forward_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f| = field(f, :match) diff --git a/app/views/fluentd/settings/out_mongo/_form.html.haml b/app/views/fluentd/settings/out_mongo/_form.html.haml index 9695c0d..2c82c02 100644 --- a/app/views/fluentd/settings/out_mongo/_form.html.haml +++ b/app/views/fluentd/settings/out_mongo/_form.html.haml @@ -1,5 +1,4 @@ -- @setting.errors.full_messages.each do |msg| - = msg += render "shared/setting_errors" = form_for(@setting, url: finish_fluentd_setting_out_mongo_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f| = field(f, :match) diff --git a/app/views/fluentd/settings/out_s3/_form.html.haml b/app/views/fluentd/settings/out_s3/_form.html.haml index 7523f98..d733cdd 100644 --- a/app/views/fluentd/settings/out_s3/_form.html.haml +++ b/app/views/fluentd/settings/out_s3/_form.html.haml @@ -1,5 +1,4 @@ -- @setting.errors.full_messages.each do |msg| - = msg += render "shared/setting_errors" = form_for(@setting, url: finish_fluentd_setting_out_s3_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f| = field(f, :match) diff --git a/app/views/fluentd/settings/out_td/_form.html.haml b/app/views/fluentd/settings/out_td/_form.html.haml index 68026cf..7ade849 100644 --- a/app/views/fluentd/settings/out_td/_form.html.haml +++ b/app/views/fluentd/settings/out_td/_form.html.haml @@ -1,5 +1,4 @@ -- @setting.errors.full_messages.each do |msg| - = msg += render "shared/setting_errors" = form_for(@setting, url: finish_fluentd_setting_out_td_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f| = field(f, :match) diff --git a/app/views/shared/_setting_errors.html.haml b/app/views/shared/_setting_errors.html.haml new file mode 100644 index 0000000..425c4d7 --- /dev/null +++ b/app/views/shared/_setting_errors.html.haml @@ -0,0 +1,5 @@ +- if request.post? && !@setting.valid? + .well.well-sm + - @setting.errors.full_messages.each do |msg| + .text.text-danger= msg +