Sha256: a4c363e339831bdd6508bc036490adc284f2416c33546e9ef37d48fa23253b9d

Contents?: true

Size: 651 Bytes

Versions: 5

Compression:

Stored size: 651 Bytes

Contents

module ActiveAdmin
  module Views

    class SidebarSection < Panel
      builder_method :sidebar_section

      # Takes a ActiveAdmin::Sidebar::Section 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
          self << capture do
            render @section.partial_name
          end
        end
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
saulolso-activeadmin-0.2.2.1 lib/active_admin/views/components/sidebar_section.rb
saulolso-activeadmin-0.2.2 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.2.2 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.2.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-0.2.0 lib/active_admin/views/components/sidebar_section.rb