Class: ActiveAdmin::Views::SemanticInputsProxy

Inherits:
FormtasticProxy
  • Object
show all
Defined in:
lib/active_admin/views/components/active_admin_form.rb

Instance Method Summary collapse

Methods inherited from FormtasticProxy

#closing_tag, #opening_tag, #split_string_on, #to_s

Instance Method Details

#build(form_builder, *args, &block) ⇒ Object


97
98
99
100
101
102
103
104
105
106
# File 'lib/active_admin/views/components/active_admin_form.rb', line 97

def build(form_builder, *args, &block)
  options = args.extract_options!
  legend = args.shift
  legend_tag = legend ? "<legend><span>#{legend}</span></legend>" : ""
  klasses = ["inputs"]
  klasses << options[:class] if options[:class]
  @opening_tag = "<fieldset class=\"#{klasses.join(" ")}\">#{legend_tag}<ol>"
  @closing_tag = "</ol></fieldset>"
  super(*(args << options), &block)
end