Sha256: 5e1de8f7ee5a6be17f268843b5960cfe4ad7fc90f38b875b4ea673c3d3a1573a

Contents?: true

Size: 484 Bytes

Versions: 21

Compression:

Stored size: 484 Bytes

Contents

class ComfortableMexicanSofa::Tag::Template
  include ComfortableMexicanSofa::Tag

  def self.regex_tag_signature(identifier = nil)
    identifier ||= /[\w\/\-]+/
    /\{\{\s*cms:template:(#{identifier})\s*\}\}/
  end

  def content
    "<%= render :template => '#{identifier}' %>"
  end

  def render
    whitelist = ComfortableMexicanSofa.config.allowed_templates
    if whitelist.is_a?(Array)
      content if whitelist.member?(identifier)
    else
      content
    end
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.9.2 lib/comfortable_mexican_sofa/tags/template.rb