Module: Adminterface::Extensions::Views::ActiveAdminForm

Defined in:
lib/adminterface/extensions/views/components/active_admin_form.rb

Instance Method Summary collapse

Instance Method Details

#action(method, options = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/adminterface/extensions/views/components/active_admin_form.rb', line 13

def action(method, options = {})
  if method.eql?(:submit)
    options.reverse_merge!(button_html: {class: form_css_classes.dig(:actions, :submit)})
  end

  super(method, options)
end


21
22
23
# File 'lib/adminterface/extensions/views/components/active_admin_form.rb', line 21

def cancel_link(url = {action: "index"}, html_options = {class: form_css_classes.dig(:actions, :cancel)}, li_attrs = {})
  super(url, html_options, li_attrs)
end

#inputObject



5
6
7
8
9
10
11
# File 'lib/adminterface/extensions/views/components/active_admin_form.rb', line 5

def input(...)
  default_field_error_proc = ::ActionView::Base.field_error_proc
  ::ActionView::Base.field_error_proc = proc { |html_tag, _instance_tag| html_tag }
  super
ensure
  ::ActionView::Base.field_error_proc = default_field_error_proc
end