Sha256: 05d7b37082970d3736a1ce07c195d873f8220f61a84729cf8097fbfe36a5580d
Contents?: true
Size: 892 Bytes
Versions: 16
Compression:
Stored size: 892 Bytes
Contents
require 'active_admin/helpers/output_safety_helper' module ActiveAdmin module Views class SidebarSection < Panel builder_method :sidebar_section include OutputSafetyHelper # 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
16 entries across 16 versions & 3 rubygems