Permalink
Browse files

generate required attribute for `date_time` input

closes #730
  • Loading branch information...
1 parent 8071bfd commit 77b6c821d26f8499a1185172676081b553274c33 @nashby nashby committed Jan 18, 2013
Showing with 5 additions and 6 deletions.
  1. +3 −0 CHANGELOG.md
  2. +0 −4 lib/simple_form/inputs/date_time_input.rb
  3. +2 −2 test/inputs/datetime_input_test.rb
View
@@ -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).
@@ -5,10 +5,6 @@ def input
@builder.send(:"#{input_type}_select", attribute_name, input_options, input_html_options)
end
- def has_required?
- false
- end
-
private
def label_target
@@ -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

0 comments on commit 77b6c82

Please sign in to comment.