Sha256: 3a1bc0abce0548bde4ebe1c0a8eece8387de28fe3e569f06607115ad517076a2

Contents?: true

Size: 1.2 KB

Versions: 29

Compression:

Stored size: 1.2 KB

Contents

module Formtastic
  module Inputs

    # Outputs a simple `<label>` with a HTML5 `<input type="url">` wrapped in the standard
    # `<li>` wrapper. This is the default input choice for all attributes matching
    # `/^url$|^website$|_url$/`, but can be applied to any text-like input with `:as => :url`.
    #
    # @example Full form context and output
    #
    #   <%= semantic_form_for(@user) do |f| %>
    #     <%= f.inputs do %>
    #       <%= f.input :home_page, :as => :url %>
    #     <% end %>
    #   <% end %>
    #
    #   <form...>
    #     <fieldset>
    #       <ol>
    #         <li class="url">
    #           <label for="user_home_page">Home page</label>
    #           <input type="number" id="user_home_page" name="user[home_page]">
    #         </li>
    #       </ol>
    #     </fieldset>
    #   </form>
    #
    # @see Formtastic::Helpers::InputsHelper#input InputsHelper#input for full documentation of all possible options.
    class UrlInput 
      include Base
      include Base::Stringish
      include Base::Placeholder
      
      def to_html
        input_wrapping do
          label_html <<
          builder.url_field(method, input_html_options)
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/lib/formtastic/inputs/url_input.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/lib/formtastic/inputs/url_input.rb
formtastic-4.0.0 lib/formtastic/inputs/url_input.rb
formtastic-4.0.0.rc1 lib/formtastic/inputs/url_input.rb
formtastic-3.1.5 lib/formtastic/inputs/url_input.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/lib/formtastic/inputs/url_input.rb
formtastic-3.1.4 lib/formtastic/inputs/url_input.rb
formtastic-3.1.3 lib/formtastic/inputs/url_input.rb
formtastic-3.1.2 lib/formtastic/inputs/url_input.rb
formtastic-3.1.1 lib/formtastic/inputs/url_input.rb
formtastic-3.1.0 lib/formtastic/inputs/url_input.rb
formtastic-3.1.0.rc2 lib/formtastic/inputs/url_input.rb
formtastic-3.1.0.rc1 lib/formtastic/inputs/url_input.rb
formtastic-3.0.0 lib/formtastic/inputs/url_input.rb
formtastic-3.0.0.rc2 lib/formtastic/inputs/url_input.rb
formtastic-2.3.1 lib/formtastic/inputs/url_input.rb
formtastic-2.3.0 lib/formtastic/inputs/url_input.rb
formtastic-3.0.0.rc lib/formtastic/inputs/url_input.rb
formtastic-2.3.0.rc4 lib/formtastic/inputs/url_input.rb
formtastic-2.3.0.rc3 lib/formtastic/inputs/url_input.rb