Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-08-21 17:01:05 +0300
committerNick Thomas <nick@gitlab.com>2017-08-30 22:50:44 +0300
commitb49b7bc147955df6589b13942d0437a3b4518c7b (patch)
treec796cb83a10509aad8b5aeae39e139db2fdb3156 /app/helpers/form_helper.rb
parentb0f982fbdf69c292ab4530c0aaaf1ab42f4e7a01 (diff)
Warn users when their keys are invalid
Diffstat (limited to 'app/helpers/form_helper.rb')
-rw-r--r--app/helpers/form_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb
index 9247b1f72de..2e05b8c6d65 100644
--- a/app/helpers/form_helper.rb
+++ b/app/helpers/form_helper.rb
@@ -1,9 +1,10 @@
module FormHelper
- def form_errors(model)
+ def form_errors(model, headline = 'The form contains the following')
return unless model.errors.any?
pluralized = 'error'.pluralize(model.errors.count)
- headline = "The form contains the following #{pluralized}:"
+
+ headline = headline + ' ' + pluralized + ':'
content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do
content_tag(:h4, headline) <<