Class: ActiveAdmin::Views::FormtasticProxy

Inherits:
Arbo::Rails::Forms::FormBuilderProxy
  • Object
show all
Defined in:
lib/active_admin/views/components/active_admin_form.rb

Instance Method Summary collapse

Instance Method Details

#closing_tagObject



14
15
16
# File 'lib/active_admin/views/components/active_admin_form.rb', line 14

def closing_tag
  @closing_tag || ""
end

#opening_tagObject



10
11
12
# File 'lib/active_admin/views/components/active_admin_form.rb', line 10

def opening_tag
  @opening_tag || ""
end

#render_in(context = arbo_context) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/active_admin/views/components/active_admin_form.rb', line 18

def render_in(context = arbo_context)
  pos = context.output_buffer.length
  context.output_buffer << opening_tag.html_safe
  children.map { |element| element.render_in(context) }
  context.output_buffer << closing_tag.html_safe
  pos > 0 ? context.output_buffer.to_str[pos..] : context.output_buffer
end

#split_string_on(string, match) ⇒ Object



4
5
6
7
8
# File 'lib/active_admin/views/components/active_admin_form.rb', line 4

def split_string_on(string, match)
  return "" unless string && match
  part_1 = string.split(Regexp.new("#{match}\\z")).first
  [part_1, match]
end

#to_sObject



26
27
28
# File 'lib/active_admin/views/components/active_admin_form.rb', line 26

def to_s
  opening_tag + children.to_s + closing_tag
end