Sha256: 450f13ae1803bf48a41b7fbb8341e09a807bce2b33750aea3379c89c3fd3c25f
Contents?: true
Size: 1.25 KB
Versions: 1
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true module Formtastic module Inputs # Outputs a simple `<label>` with a HTML5 `<input type="email">` wrapped in the standard # `<li>` wrapper. This is the default input choice for attributes with a name matching # `/email/`, but can be applied to any text-like input with `:as => :email`. # # @example Full form context and output # # <%= semantic_form_for(@user) do |f| %> # <%= f.inputs do %> # <%= f.input :email_address, :as => :email %> # <% end %> # <% end %> # # <form...> # <fieldset> # <ol> # <li class="email"> # <label for="user_email_address">Email address</label> # <input type="email" id="user_email_address" name="user[email_address]"> # </li> # </ol> # </fieldset> # </form> # # @see Formtastic::Helpers::InputsHelper#input InputsHelper#input for full documentation of all possible options. class EmailInput include Base include Base::Stringish include Base::Placeholder def to_html input_wrapping do label_html << builder.email_field(method, input_html_options) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
formtastic-5.0.0 | lib/formtastic/inputs/email_input.rb |