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

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


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

def title
  if form_presenter[:title]
    render_or_call_method_or_proc_on(resource, form_presenter[:title])
  else
    assigns[:page_title] || I18n.t("active_admin.#{normalized_action}_model",
                              model: active_admin_config.resource_label)
  end
end