I've +1'ed the smaller options["type"] ||= field_type patch for now but I'd like to see this go farther in some way.
Look at how the spec (http://www.w3.org/TR/html5/) divides inputs by "states of the type attribute". One extreme solution for Rails would be an input_field with a ton of options. The other extreme is a helper for each state. Right now, there's not much difference between text fields and telephone, search, and email fields. The date pickers, numbers, and ranges "feel" different: http://diveintohtml5.org/forms.html So, a slightly more incremental change might be to introduce number and range tags. Simply having all of these helpers around, however, is great encouragement for Rails developers and "Rails 3: HTML5 friendly" has a nice marketing ring to it. On Mon, Jan 4, 2010 at 9:31 AM, Stephen Celis <[email protected]> wrote: > HTML5 is becoming more popular, and there's already some benefit in > using HTML5 in browsers that support it, like MobileSafari, Safari, > and Opera. > > I've created a patch (with tests) that adds the following input tag > helpers: > > - email_field_tag (and email_field) > - url_field_tag (etc.) > - telephone_field_tag (aliased to phone_field_tag) > - number_field_tag > - range_field_tag > - search_field_tag > > The ticket/patch is available here: > > https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3646-html5-form-field-helpers-email_field_tag-etc > > Some may feel that something like "text_field_tag 'email', nil, :type > => 'email'" is good enough, but this doesn't work for "text_field" > because any "type" option is overridden to "text" (this could be fixed > with a smaller patch). > > I do think, though, that providing helper methods like > "email_field_tag" will encourage wider adoption of HTML5, and that's a > good thing for everyone. > > Stephen > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- Dan Croak @Croaky
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
