Sha256: 5cdd3bf86d44d04dea7ba132573b81ebf4e918c3ee1e9a72ac64face3b19169c
Contents?: true
Size: 1.46 KB
Versions: 4
Compression:
Stored size: 1.46 KB
Contents
module Formtastic module Inputs # Outputs a simple `<label>` with a `<input type="file">` wrapped in the standard # `<li>` wrapper. This is the default input choice for objects with attributes that appear # to be for file uploads, by detecting some common method names used by popular file upload # libraries such as Paperclip and CarrierWave. You can add to or alter these method names # through the `file_methods` config, but can be applied to any input with `:as => :file`. # # Don't forget to set the multipart attribute in your `<form>` tag! # # @example Full form context and output # # <%= semantic_form_for(@user, :html => { :multipart => true }) 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 documetation of all possible options. class FileInput include Base def to_html input_wrapping do label_html << builder.file_field(method, input_html_options) end end end end end
Version data entries
4 entries across 4 versions & 2 rubygems