Commit Graph

11 Commits

Author SHA1 Message Date
Rafael Mendonça França 12e6d89b77 Remove all warnings of invalid CSS selector 2014-09-08 17:19:40 -03:00
John Voloski e878330f28 improve inputs's tests description and remove 'should' 2014-05-14 14:19:06 -03:00
Volmer Soares 5590f85ee1 Use classic datetime selects unless HTML5 is explicitly enabled. 2013-11-16 02:25:24 -02:00
Volmer Soares a7c9575a4e Do not assert `required` HTML5 attribute when HTML5 compatibility is disabled. 2013-11-13 16:50:09 -02:00
Volmer Soares fb1f52dbc5 Support to date, datetime and time inputs.
I changed `DateTimeInput` to support the new HTML5 form helpers that
comes with Rails 4 (`date_input`, `datetime_input` and `time_input`)
instead of rendering datetime selects:

For example, this input:
```erb
<%= f.input :born_on, as: :date %>
```
Will render:
```html
<input id="user_born_on" name="user[born_on]" type="date" />
```

Datetime selects are still present, but only when HTML5 compatibility
is disabled. It's also possible to render selects even with HTML5 on,
by setting the `html5` option to false.

If we wanted to use an old date select on the example above, we should do:
```erb
<%= f.input :born_on, as: :date, html5: false %>
```

Closes #844.
2013-11-13 14:44:42 -02:00
Matt Jankowski c00533bf7c Handle situation when I18n date.order values are strings
Rails 4 changes the `date.order` I18n setting to return strings, which
resulted in a missed lookup in POSITION, and a value like `date_i`
instead of `date_1i` for the `for` attribute on `label` elements.
2013-07-17 10:56:42 -04:00
Cameron Cundiff d189adf149 Test aria-required for datetime input.
[#780]
2013-04-07 13:59:49 -04:00
Renato Mascarenhas 34312c9fbc Use 1.9 hash style on code and docs. 2013-01-28 19:02:59 -02:00
Vasiliy Ermolovich 77b6c821d2 generate required attribute for `date_time` input
closes #730
2013-01-19 14:16:28 +03:00
George Hemmings 151b0d8fb9 Fix label for datetime inputs, point to first select
Point the label for datetime inputs at the first select. The date order can be
overridden by i18n and on a per-input basis. Use the specified order to
discover the first select.
2012-02-04 14:49:44 +00:00
José Valim cc72315703 Break inputs_test.rb into many files as well. 2011-09-08 16:04:36 +02:00