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.5.7 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.6 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.6.rc2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.6.rc1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.5 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.4 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.3 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.0 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.0.rc3 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.0.rc2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.5.0.rc1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.4.1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.4.0 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.3.1 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.3.0 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.2.3 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.2.2 app/inputs/locomotive/empty_input.rb
locomotive_cms-2.2.1 app/inputs/locomotive/empty_input.rb