Sha256: da32f707e5bad2e5945739fa990cadea167d32fde102d6629f09f9c810d16a37

Contents?: true

Size: 806 Bytes

Versions: 37

Compression:

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

      # Renders attributes_table_for current resource
      def attributes_table(*args, &block)
        attributes_table_for resource, *args, &block
      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

37 entries across 37 versions & 6 rubygems

Version Path
activeadmin-rails-1.7.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-rails-1.7.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-rb-1.6.0 lib/active_admin/views/components/sidebar_section.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/views/components/sidebar_section.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/views/components/sidebar_section.rb
activeadmin-rb-1.5.2 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.9.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.8.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.8.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-rb-1.5.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.7.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.6.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.6.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.5.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.4.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.3.1 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.3.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.2.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.1.0 lib/active_admin/views/components/sidebar_section.rb
activeadmin-2.0.0 lib/active_admin/views/components/sidebar_section.rb