Merge pull request #1404 from plataformatec/lm-fix-1314
Ignore the `:label_text` when rendering `label` tags.
This commit is contained in:
commit
daaf41a2fc
|
@ -299,7 +299,7 @@ module SimpleForm
|
|||
return super if args.first.is_a?(String) || block_given?
|
||||
|
||||
options = args.extract_options!.dup
|
||||
options[:label_html] = options.except(:label, :required, :as)
|
||||
options[:label_html] = options.except(:label, :label_text, :required, :as)
|
||||
|
||||
column = find_attribute_column(attribute_name)
|
||||
input_type = default_input_type(attribute_name, column, options)
|
||||
|
|
|
@ -120,4 +120,11 @@ class LabelTest < ActionView::TestCase
|
|||
assert_select 'label[for=user_time_zone]', 'Time Zone:'
|
||||
end
|
||||
end
|
||||
|
||||
test 'builder allows label specific `label_text` option' do
|
||||
with_label_for @user, :time_zone, label_text: lambda { |l, _, _| "#{l.titleize}:" }
|
||||
|
||||
assert_no_select 'label[label_text]'
|
||||
assert_select 'label[for=user_time_zone]', 'Time Zone:'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue