Sha256: c445f49d59778fda32625361ec9537a131be6e84886dc2406635a45974c12f89

Contents?: true

Size: 667 Bytes

Versions: 19

Compression:

Stored size: 667 Bytes

Contents

module ActiveAdmin
  module Views

    class SidebarSection < Panel
      builder_method :sidebar_section

      # Takes a ActiveAdmin::SidebarSection instance
      def build(section)
        @section = section
        super(@section.title, icon: @section.icon)
        add_class @section.custom_class if @section.custom_class
        self.id = @section.id
        build_sidebar_content
      end

      protected

      def build_sidebar_content
        if @section.block
          rvalue = instance_exec(&@section.block)
          self << rvalue if rvalue.is_a?(String)
        else
          render(@section.partial_name)
        end
      end
    end

  end
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
yousty-activeadmin-1.0.17.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.16.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.15.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.14.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.13.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.12.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.11.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.10.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.9.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.8.pre lib/active_admin/views/components/sidebar_section.rb
activeadmin-1.0.0.pre1 lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.7.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.6.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.5.pre lib/active_admin/views/components/sidebar_section.rb
active_administration-0.0.3 lib/active_admin/views/components/sidebar_section.rb
activeadministration-0.0.2 lib/active_admin/views/components/sidebar_section.rb
active_administration-0.0.2 lib/active_admin/views/components/sidebar_section.rb
activeadministration-0.0.1 lib/active_admin/views/components/sidebar_section.rb
active_administration-0.0.1 lib/active_admin/views/components/sidebar_section.rb