generate required attribute for `date_time` input

closes #730
This commit is contained in:
Vasiliy Ermolovich 2013-01-19 01:15:04 +03:00
parent 8071bfd96b
commit 77b6c821d2
3 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,9 @@
## 2.1.0.dev
### enhancements
* generate required attribute for `date_time` input.
([@nashby](https://github.com/nashby))
Closes [#730](https://github.com/plataformatec/simple_form/issues/730).
* `grouped_collection_select` now accepts proc/lambda as label and value method.
([@svendahlstrand](https://github.com/svendahlstrand))
Closes [#623](https://github.com/plataformatec/simple_form/issues/623).

View File

@ -5,10 +5,6 @@ module SimpleForm
@builder.send(:"#{input_type}_select", attribute_name, input_options, input_html_options)
end
def has_required?
false
end
private
def label_target

View File

@ -91,9 +91,9 @@ class DateTimeInputTest < ActionView::TestCase
assert_select 'label[for=project_created_at_4i]'
end
test 'date time input should not generate invalid required html attribute' do
test 'date time input should generate required html attribute' do
with_input_for @user, :delivery_time, :time, :required => true
assert_select 'select.required'
assert_no_select 'select[required]'
assert_select 'select[required]'
end
end