Sha256: 83e344a2ec2d61c023366220f6badd8ca0aeae28f7cdf946e47d35ec517c7091
Contents?: true
Size: 612 Bytes
Versions: 11
Compression:
Stored size: 612 Bytes
Contents
module ExpressAdmin class WidgetBox < ExpressTemplates::Components::Configurable has_option :title, 'The title to be displayed.' contains -> (&block) { header(class: 'title') { box_title } div(class: 'widget-body') { block.call(self) if block } } before_build -> { set_attribute(:id, "#{config[:id].to_s.dasherize}-box") } protected def resource_name config[:id].to_s.titleize end def box_title config[:title] || (helpers.resource.persisted? ? "Edit #{resource_name}" : "New #{resource_name}") end end end
Version data entries
11 entries across 11 versions & 1 rubygems