Sha256: e769aa53ba45ea3362273f966d22b83ddbe6f1aca4ff23e0f425604752820094

Contents?: true

Size: 489 Bytes

Versions: 26

Compression:

Stored size: 489 Bytes

Contents

module Locomotive
  class SmallCodeInput < Formtastic::Inputs::TextInput

    def wrapper_html_options
      super.tap do |opts|
        opts[:class] += ' code small'
      end
    end

    def input_wrapping(&block)
      template.content_tag(:li,
        [template.capture(&block), error_html, error_anchor, hint_html].join("\n").html_safe,
        wrapper_html_options
      )
    end

    def error_anchor
      template.content_tag(:span, '', class: 'error-anchor')
    end

  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotive_cms-2.2.0 app/inputs/locomotive/small_code_input.rb
locomotive_cms-2.1.4 app/inputs/locomotive/small_code_input.rb
locomotive_cms-2.1.3 app/inputs/locomotive/small_code_input.rb
locomotive_cms-2.1.2 app/inputs/locomotive/small_code_input.rb
locomotive_cms-2.1.1 app/inputs/locomotive/small_code_input.rb
locomotive_cms-2.1.0 app/inputs/locomotive/small_code_input.rb