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


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

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

#main_contentObject


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

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


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

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