Sha256: 199f73ff0d266f52df3408ef3bce366d34a1a59acfc099d5aa5ba62bafb3a69f

Contents?: true

Size: 557 Bytes

Versions: 43

Compression:

Stored size: 557 Bytes

Contents

module Locomotive
  class EmptyInput
    include Formtastic::Inputs::Base

    def to_html
      input_wrapping do
        label_html
        # render nothing
      end
    end

    def association_primary_key
      begin
        super
      rescue Exception => e
        # does not work correctly with embedded collections
      end
    end

    def wrapper_html_options
      super.tap do |opts|
        opts[:class] += ' no-label' unless render_label?
      end
    end

    def error_html
      ""
    end

    def errors?
      false
    end

  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
locomotive_cms-2.2.0 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.1.4 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.1.3 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.1.2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.1.1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.1.0 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.3 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0 app/inputs/locomotive/empty_input.rb
tribeca_cms-0.1.1 app/inputs/locomotive/empty_input.rb
tribeca_cms-2.0.0.rc12 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc12 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc11 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc10 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc9 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc8 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc7 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc6 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.0.0.rc5 app/inputs/locomotive/empty_input.rb