2011-11-25 14:10:56 +00:00
|
|
|
module Locomotive
|
2012-02-01 01:01:42 +00:00
|
|
|
class EmptyInput
|
2011-11-25 14:10:56 +00:00
|
|
|
include Formtastic::Inputs::Base
|
|
|
|
|
|
|
|
def to_html
|
|
|
|
input_wrapping do
|
|
|
|
label_html
|
|
|
|
# render nothing
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-12-22 01:59:30 +00:00
|
|
|
def association_primary_key
|
|
|
|
begin
|
|
|
|
super
|
|
|
|
rescue Exception => e
|
|
|
|
# does not work correctly with embedded collections
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-11-29 13:58:19 +00:00
|
|
|
def wrapper_html_options
|
|
|
|
super.tap do |opts|
|
|
|
|
opts[:class] += ' no-label' unless render_label?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-11-25 14:10:56 +00:00
|
|
|
def error_html
|
|
|
|
""
|
|
|
|
end
|
|
|
|
|
|
|
|
def errors?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|