Sha256: 2eb39f6bef2fb3e75337d1e890ffc15dd5bc3c1505870b283cab61bf252651f3
Contents?: true
Size: 1.18 KB
Versions: 9
Compression:
Stored size: 1.18 KB
Contents
module Formtastic module Inputs # Outputs a simple `<label>` with a HTML5 `<input type="search">` wrapped in the standard # `<li>` wrapper. This is the default input choice for attributes with a name matching # `/^search$/`, but can be applied to any text-like input with `:as => :search`. # # @example Full form context and output # # <%= semantic_form_for(@search, :html => { :method => :get }) do |f| %> # <%= f.inputs do %> # <%= f.input :q, :as => :search, :label => false, :input_html => { :name => "q" } %> # <% end %> # <% end %> # # <form...> # <fieldset> # <ol> # <li class="search"> # <input type="search" id="search_q" name="q"> # </li> # </ol> # </fieldset> # </form> # # @see Formtastic::Helpers::InputsHelper#input InputsHelper#input for full documetation of all possible options. class SearchInput include Base include Base::Stringish def to_html input_wrapping do label_html << builder.search_field(method, input_html_options) end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems