Sha256: b906549a841e1c879c1180872f29251e731edbfc3c0ac2849ed9ba11460b82ca

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

class Admin::IcalsController < Admin::ResourceController

  def refresh_all
    # This is the correct line for the agent to run.  
    # Calendar::refresh_all
    
    # We'll keep using this so we can keep an eye on the downlaod status until an agent and proper error checking is implemented.
    @icals = Ical.find(:all)
    @icals.each do |ical|
      ical.refresh
    end
    flash[:notice] = "iCal subscription refresh complete."
    redirect_to admin_calendars_path
  end 
  
  def refresh
    ical = Ical.find(params[:id])
    if ical.refresh
      flash[:notice] = ical.calendar.name + " calendar refreshed from iCal subscription ."
    else
      flash[:notice] = "Error parsing " + ical.calendar.name + " calendar from iCal subscription."
    end
    redirect_to :back
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-event_calendar-extension-1.0.2 app/controllers/admin/icals_controller.rb
radiant-event_calendar-extension-1.0.1 app/controllers/admin/icals_controller.rb
radiant-event_calendar-extension-1.0.0 app/controllers/admin/icals_controller.rb