Sha256: 9168b6d014d610e5a769b89c3ac0d3a020aefc22d7eef1c4ae9619924c91a8d6

Contents?: true

Size: 777 Bytes

Versions: 23

Compression:

Stored size: 777 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

23 entries across 23 versions & 3 rubygems

Version Path
activeadmin-rb-1.6.0 lib/active_admin/page_dsl.rb
activeadmin-rb-1.5.2 lib/active_admin/page_dsl.rb
activeadmin-rb-1.5.1 lib/active_admin/page_dsl.rb
activeadmin-rb-1.5.0 lib/active_admin/page_dsl.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin-rb-1.4.0 lib/active_admin/page_dsl.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin-1.4.3 lib/active_admin/page_dsl.rb
activeadmin-1.4.2 lib/active_admin/page_dsl.rb
activeadmin-1.4.1 lib/active_admin/page_dsl.rb
activeadmin-1.4.0 lib/active_admin/page_dsl.rb
activeadmin-1.3.1 lib/active_admin/page_dsl.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin-1.3.0 lib/active_admin/page_dsl.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_dsl.rb
activeadmin-1.2.1 lib/active_admin/page_dsl.rb
activeadmin-1.2.0 lib/active_admin/page_dsl.rb