Sha256: ea28bad1be770630c65558eebde087ef025eaf17a751581be0260d1c18497e55
Contents?: true
Size: 838 Bytes
Versions: 14
Compression:
Stored size: 838 Bytes
Contents
module ModsDisplay module ControllerExtension def self.included(base) base.extend ClassMethods base.class_eval do def mods_display_config @mods_display_config || self.class.mods_display_config end if base.respond_to?(:helper_method) helper_method :mods_display_config, :render_mods_display end end end def render_mods_display(model) return '' if model.mods_display_xml.nil? ModsDisplay::HTML.new(mods_display_config, model.mods_display_xml, self) end private module ClassMethods def configure_mods_display(&config) @mods_display_config = ModsDisplay::Configuration.new(&config) end def mods_display_config @mods_display_config || ModsDisplay::Configuration.new {} end end end end
Version data entries
14 entries across 14 versions & 1 rubygems