Sha256: c8a33f47539c8a428550d6b4492b0067818327a5de2f76709b16e6ce3a661ec9
Contents?: true
Size: 963 Bytes
Versions: 5
Compression:
Stored size: 963 Bytes
Contents
module ActiveAdmin class SidebarSection include ActiveAdmin::OptionalDisplay attr_accessor :name, :options, :block def initialize(name, options = {}, &block) @name, @options, @block = name, options, block normalize_display_options! end # The id gets used for the div in the view def id "#{name.to_s.downcase.underscore}_sidebar_section".parameterize end def icon? !!options[:icon] end def icon options[:icon] if icon? end # The title gets displayed within the section in the view def title I18n.t("active_admin.sidebars.#{name.to_s}", default: name.to_s.titlecase) end # If a block is not passed in, the name of the partial to render def partial_name options[:partial] || "#{name.to_s.downcase.gsub(' ', '_')}_sidebar" end def custom_class options[:class] end def priority options[:priority] || 10 end end end
Version data entries
5 entries across 5 versions & 2 rubygems