Class: ComfortableMexicanSofa::Tag::Template
Constant Summary
IDENTIFIER_REGEX, TOKENIZER_REGEX
Instance Attribute Summary
#blockable, #identifier, #namespace, #params, #parent
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.regex_tag_signature(identifier = nil) ⇒ Object
4
5
6
7
|
# File 'lib/comfortable_mexican_sofa/tags/template.rb', line 4
def self.regex_tag_signature(identifier = nil)
identifier ||= /[\w\/\-]+/
/\{\{\s*cms:template:(#{identifier})\s*\}\}/
end
|
Instance Method Details
#content ⇒ Object
9
10
11
|
# File 'lib/comfortable_mexican_sofa/tags/template.rb', line 9
def content
"<%= render :template => '#{identifier}' %>"
end
|
#render ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/comfortable_mexican_sofa/tags/template.rb', line 13
def render
whitelist = ComfortableMexicanSofa.config.allowed_templates
if whitelist.is_a?(Array)
content if whitelist.member?(identifier)
else
content
end
end
|