Form input type="date" in Ruby on Rails
ruby-on-rails, ruby-on-rails-3, ruby-on-rails-4
Solution
You can see the lastest docs that the `date_field` helper provide that. That seems a functionality from Rails 4.
Example from docs:
date_field("user", "born_on")
# => <input id="user_born_on" name="user[born_on]" type="date" />
Problem
I want to have a date input for a form. I know this only works in some browsers: ``` <input type="date" name="birth_day"/> ``` Is there a convenient method for this in Ruby on Rails? The documentation for the various form elements list many other input types, but I don't see anything for dates: - email_field - number_field - phone_field - range_field - search_field - telephone_field - text_field I know about date_select, that's not what I want. I want the above HTML output. I'm using Ruby on Rails 3.2.13. Is there possibly a `date_field` in Ruby on Rails 4? Or another way to do this?