Sha256: 7dae1259a7b1059c6f972237ca24b4d3f485886c20cff95ea52e2daecf4f43e1

Contents?: true

Size: 610 Bytes

Versions: 71

Compression:

Stored size: 610 Bytes

Contents

# This allows the app to call f.input :something, :as => :asset_box
# in either Formtastic or SimpleForm, but not both at the same time

if defined?(SimpleForm)
  class AssetBoxInput < SimpleForm::Inputs::FileInput
    def input(wrapper_options = nil)
      Inputs::AssetBox.new(object, object_name, template, attribute_name, options).to_html
    end
  end
elsif defined?(Formtastic)
  class AssetBoxInput < Formtastic::Inputs::FileInput
    def to_html
      input_wrapping do
        label_html << Inputs::AssetBox.new(@object, @object_name, @template, @method, @options).to_html
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
effective_assets-1.3.1 app/models/inputs/asset_box_input.rb
effective_assets-1.3.0 app/models/inputs/asset_box_input.rb
effective_assets-1.2.5 app/models/inputs/asset_box_input.rb
effective_assets-1.2.4 app/models/inputs/asset_box_input.rb
effective_assets-1.2.3 app/models/inputs/asset_box_input.rb
effective_assets-1.2.2 app/models/inputs/asset_box_input.rb
effective_assets-1.2.0 app/models/inputs/asset_box_input.rb
effective_assets-1.1.2 app/models/inputs/asset_box_input.rb
effective_assets-1.1.1 app/models/inputs/asset_box_input.rb
effective_assets-1.1.0 app/models/inputs/asset_box_input.rb
effective_assets-1.0.0 app/models/inputs/asset_box_input.rb