Module: FieldsHelper

Defined in:
app/helpers/fields_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_fields_formObject



2
3
4
# File 'app/helpers/fields_helper.rb', line 2

def current_fields_form
  @_fields_helper_forms&.last
end

#with_field_settings(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/fields_helper.rb', line 6

def with_field_settings(options)
  @_fields_helper_forms ||= []

  if options[:form]
    @_fields_helper_forms << options[:form]
  end

  yield

  if options[:form]
    @_fields_helper_forms.pop
  end
end