Class: ActiveAdmin::Views::Pages::Form

Inherits:
Base
  • Object
show all
Defined in:
lib/active_admin/views/pages/form.rb

Instance Method Summary collapse

Methods inherited from Base

#build, #html_title

Instance Method Details

#form_presenterObject



16
17
18
# File 'lib/active_admin/views/pages/form.rb', line 16

def form_presenter
  active_admin_config.get_page_presenter(:form) || default_form_config
end

#main_contentObject



20
21
22
23
24
25
26
27
28
# File 'lib/active_admin/views/pages/form.rb', line 20

def main_content
  options = default_form_options.merge form_presenter.options

  if options[:partial]
    render options[:partial]
  else
    active_admin_form_for resource, options, &form_presenter.block
  end
end

#titleObject



8
9
10
11
12
13
14
# File 'lib/active_admin/views/pages/form.rb', line 8

def title
  if form_presenter[:title]
    helpers.render_or_call_method_or_proc_on(resource, form_presenter[:title])
  else
    assigns[:page_title] || ActiveAdmin::Localizers.resource(active_admin_config).t("#{normalized_action}_model")
  end
end