Permalink
Browse files

Remove leading and trailing whitespace from label_text

Closes #492
  • Loading branch information...
1 parent 280edf4 commit ec834474bbdad3efb83e621565f4bf9c2d727e54 @rafaelfranca rafaelfranca committed Mar 3, 2012
Showing with 5 additions and 1 deletion.
  1. +2 −0 CHANGELOG.md
  2. +1 −1 lib/simple_form/components/labels.rb
  3. +2 −0 test/test_helper.rb
View
2 CHANGELOG.md
@@ -6,6 +6,8 @@
### bug fix
* Fix `min_max` component to not output maximum value. ([@julian7](https://github.com/julian7)).
Closes [#483](https://github.com/plataformatec/simple_form/issues/483)
+ * Remove leading and trailing whitespace from `label_text`
+ Closes [#492](https://github.com/plataformatec/simple_form/issues/492)
## 2.0.1
View
2 lib/simple_form/components/labels.rb
@@ -30,7 +30,7 @@ def label
end
def label_text
- SimpleForm.label_text.call(raw_label_text, required_label_text).html_safe
+ SimpleForm.label_text.call(raw_label_text, required_label_text).strip.html_safe
end
def label_target
View
2 test/test_helper.rb
@@ -32,6 +32,8 @@ def self.env
require 'country_select'
+ActionDispatch::Assertions::NO_STRIP << "label"
+
class ActionView::TestCase
include MiscHelpers
include SimpleForm::ActionViewExtensions::FormHelper

0 comments on commit ec83447

Please sign in to comment.