Sha256: 4b507fdf27bc01d3c6df09c431c0d5c4f761c8a269b14f56b65e423daec8fa5d

Contents?: true

Size: 415 Bytes

Versions: 9

Compression:

Stored size: 415 Bytes

Contents

class ComfortableMexicanSofa::Tag::Partial
  include ComfortableMexicanSofa::Tag
  
  def self.regex_tag_signature(label = nil)
    label ||= /[\w\/\-]+/
    /\{\{\s*cms:partial:(#{label}):?(.*?)\s*\}\}/
  end
  
  def content
    ps = params.split(':').collect_with_index{|p, i| ":param_#{i+1} => '#{p}'"}.join(', ')
    "<%= render :partial => '#{label}'#{ps.blank?? nil : ", :locals => {#{ps}}"} %>"
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.2.6 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.5 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.4 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.3 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.2 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.1 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.2.0 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.1.2 lib/comfortable_mexican_sofa/tags/partial.rb
comfortable_mexican_sofa-1.1.1 lib/comfortable_mexican_sofa/tags/partial.rb