Simplification génération du flux rss, pour accélérer sa création

This commit is contained in:
echarp 2014-10-26 17:25:32 +01:00
parent b6238ad910
commit 8d8c732504

View File

@ -32,9 +32,7 @@ xml.rdf :RDF,
@events.each do |event| @events.each do |event|
xml.item 'rdf:about' => event_url(event) do xml.item 'rdf:about' => event_url(event) do
title = event.city xml.title "#{event.city}: #{event.title}, #{display_date event}"
title += ": #{event.title}"
xml.title title + ", #{l event.start_time.to_date, format: :long}"
xml.link event_url event xml.link event_url event
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '') domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
xml.dc :identifier, "#{event.id}@#{domain}" xml.dc :identifier, "#{event.id}@#{domain}"
@ -43,11 +41,8 @@ xml.rdf :RDF,
xml.georss :point, event.latitude, ' ', event.longitude xml.georss :point, event.latitude, ' ', event.longitude
end end
@event = event xml.description strip_tags event.description
content = render file: '/events/show.html', locals: { rss: true } xml.content(:encoded) { xml.cdata! event.description }
xml.description strip_tags content
xml.content(:encoded) { xml.cdata! content }
end end
end end
end end