Sha256: f06657fbff4a55f76ccedf3cd3b66e22e54ae520233a8bd32d14ca8247567e39
Contents?: true
Size: 617 Bytes
Versions: 49
Compression:
Stored size: 617 Bytes
Contents
class ComfortableMexicanSofa::Tag::Partial include ComfortableMexicanSofa::Tag def self.regex_tag_signature(identifier = nil) identifier ||= /[\w\/\-]+/ /\{\{\s*cms:partial:(#{identifier}):?(.*?)\s*\}\}/ end def content ps = params.collect_with_index{|p, i| ":param_#{i+1} => '#{p}'"}.join(', ') "<%= render :partial => '#{identifier}'#{ps.blank?? nil : ", :locals => {#{ps}}"} %>" end def render whitelist = ComfortableMexicanSofa.config.allowed_partials if whitelist.is_a?(Array) content if whitelist.member?(identifier) else content end end end
Version data entries
49 entries across 49 versions & 1 rubygems