19 ms·
a quick monkey patch for rails to be able to do 'f.text_field "email", :type => "email"' (though i guess f.email_field would be more appropriate but more code)
by there 17y ago
a quick monkey patch for rails to be able to do 'f.text_field "email", :type => "email"' (though i guess f.email_field would be more appropriate but more code)
module ActionView::Helpers
class InstanceTag
alias :orig_to_input_field_tag :to_input_field_tag
def to_input_field_tag(field_type, options = {})
orig_to_input_field_tag(options["type"] || field_type, options)
end
end
end
- stephencelis 17y agoI've added a few HTML5 form helpers to this gem: http://github.com/stephencelis/rerails/tree/2-3-stable http://github.com/stephencelis/rerails/tree/2-3-stable So something like this would do the trick: <%= f.email_field :email %>