Optimisation rapide pour génération fichier ical

This commit is contained in:
echarp 2015-01-21 16:12:16 +01:00
parent 8fed58c387
commit 741bee5fbc
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ class EventsController < ApplicationController
respond_to do |format|
format.html { render layout: 'iframe' if params[:iframe] }
format.rss { @events = @events.future }
format.ics { @events = @events.last_year }
format.ics { @events = @events.last_year.includes :related_region }
format.xml { @events = @events.includes :related_region }
end
end

View File

@ -10,9 +10,9 @@ BEGIN:VEVENT
DTSTART:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title.gsub(/,/, '\,').gsub(/;/, '\;') %>
SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %>
URL:<%= event_url event %>
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(/,/, '\,').gsub(/;/, '\;').gsub /^/, ' ' %>
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(',', '\,').gsub(';', '\;').gsub(/^/, ' ') %>
LOCATION:<%= event.full_address.gsub(/,/, '\,') %>
END:VEVENT
<% end %>