Sha256: a05b0c1b90bf99ad2ae390fea130ede4a249ac3610cb2c6370cfb10e80d2be8d

Contents?: true

Size: 778 Bytes

Versions: 17

Compression:

Stored size: 778 Bytes

Contents

module ActiveAdmin
  # This is the class where all the register_page blocks are evaluated.
  class PageDSL < DSL

    # Page content.
    #
    # The block should define the view using Arbre.
    #
    # Example:
    #
    #   ActiveAdmin.register "My Page" do
    #     content do
    #       para "Sweet!"
    #     end
    #   end
    #
    def content(options = {}, &block)
      config.set_page_presenter :index, ActiveAdmin::PagePresenter.new(options, &block)
    end

    def page_action(name, options = {}, &block)
      config.page_actions << ControllerAction.new(name, options)
      controller do
        define_method(name, &block || Proc.new {})
      end
    end

    def belongs_to(target, options = {})
      config.belongs_to(target, options)
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/page_dsl.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/page_dsl.rb
activeadmin-2.9.0 lib/active_admin/page_dsl.rb
activeadmin-2.8.1 lib/active_admin/page_dsl.rb
activeadmin-2.8.0 lib/active_admin/page_dsl.rb
activeadmin-2.7.0 lib/active_admin/page_dsl.rb
activeadmin-2.6.1 lib/active_admin/page_dsl.rb
activeadmin-2.6.0 lib/active_admin/page_dsl.rb
activeadmin-2.5.0 lib/active_admin/page_dsl.rb
activeadmin-2.4.0 lib/active_admin/page_dsl.rb
activeadmin-2.3.1 lib/active_admin/page_dsl.rb
activeadmin-2.3.0 lib/active_admin/page_dsl.rb
activeadmin-2.2.0 lib/active_admin/page_dsl.rb
activeadmin-2.1.0 lib/active_admin/page_dsl.rb
activeadmin-2.0.0 lib/active_admin/page_dsl.rb
activeadmin-2.0.0.rc2 lib/active_admin/page_dsl.rb
activeadmin-2.0.0.rc1 lib/active_admin/page_dsl.rb