Sha256: 2717adc3a7f8e1e297da086d4866a0c35f2fa0bc8c53c0f7c10b88beb24bcb51
Contents?: true
Size: 1.49 KB
Versions: 7
Compression:
Stored size: 1.49 KB
Contents
xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do xml.channel do xml.title @elt.subject xml.link url_for(:only_path => false, :action => 'show', :id => @elt) xml.description @elt.subject Elt.find(:all, :select => 'SUM(value), elts.id, parent_id, elts.created_on, parent_id,' \ +'elts_count, position, elts.person_id, subject, body, lft, rgt', :conditions => "lft > #{@elt.lft} AND rgt < #{@elt.rgt}", :order => 'SUM(value) IS NULL, SUM(value) DESC, created_on DESC', :group => 'elts.id, parent_id, elts.created_on, parent_id, elts_count,' \ +'position, elts.person_id, subject, body, lft, rgt', :limit => LIST_LENGTH, :joins => "LEFT JOIN choices ON elt_id = elts.id").each do |item| xml.item do xml.title item.subject #xml.category(@elt.subject) xml.vote item.result xml.pubDate item.created_on if url_for(:only_path => false).match(/http:\/\/echarp.dyndns.org/) and @elt.id == 'blog' xml.link(url_for(:only_path => false, :controller => 'perso', :action => 'blog', :id => item.id+'.html')) xml.comments(url_for(:only_path => false, :controller => 'perso', :action => 'blog', :id => item.id+'.html')) else xml.link(url_for(:only_path => false, :action => 'show', :id => item)) xml.comments(url_for(:only_path => false, :action => 'show', :id => item)) end xml.tag!("dc:creator", item.person.name) if item.person xml.description "<p>"+format(item.body)+"</p>" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems