Sha256: a21d2574d5f2987c35586e189b2a595a54f16d20fc5bfe9d61ceb92c2e534353

Contents?: true

Size: 695 Bytes

Versions: 54

Compression:

Stored size: 695 Bytes

Contents

module ActiveAdmin
  # This is the class where all the register_page blocks are instance eval'd
  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
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/lib/active_admin/page_dsl.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/lib/active_admin/page_dsl.rb