Sha256: 5d4a1709fc80cac3c5895035345173c747557cfb1cc9a33c9d0a001f1edd9cf6

Contents?: true

Size: 605 Bytes

Versions: 12

Compression:

Stored size: 605 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)
        self.id = @section.id
        build_sidebar_content
      end

      protected

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

  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
activeadmin-0.6.6 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.6.5 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.6.4 lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.4.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.3.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.2.pre lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.6.3 lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.1.pre lib/active_admin/views/components/sidebar_section.rb
yousty-activeadmin-1.0.0.pre lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.6.2 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.6.1 lib/active_admin/views/components/sidebar_section.rb
aa-rails4-0.6.0 lib/active_admin/views/components/sidebar_section.rb