Class: Locomotive::EmptyInput

Inherits:
Object
  • Object
show all
Includes:
Formtastic::Inputs::Base
Defined in:
app/inputs/locomotive/empty_input.rb

Instance Method Summary collapse

Instance Method Details

#association_primary_keyObject



12
13
14
15
16
17
18
# File 'app/inputs/locomotive/empty_input.rb', line 12

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

#error_htmlObject



26
27
28
# File 'app/inputs/locomotive/empty_input.rb', line 26

def error_html
  ""
end

#errors?Boolean

Returns:



30
31
32
# File 'app/inputs/locomotive/empty_input.rb', line 30

def errors?
  false
end

#to_htmlObject



5
6
7
8
9
10
# File 'app/inputs/locomotive/empty_input.rb', line 5

def to_html
  input_wrapping do
    label_html
    # render nothing
  end
end

#wrapper_html_optionsObject



20
21
22
23
24
# File 'app/inputs/locomotive/empty_input.rb', line 20

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