Class: MrCommon::Reminders::DownloadsController

Inherits:
BaseController show all
Defined in:
app/controllers/mr_common/reminders/downloads_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/mr_common/reminders/downloads_controller.rb', line 9

def show
  @reminder = Reminder.find_by(slug: params[:id])

  if @reminder.nil?
    render_not_found
  else
    send_data @reminder.to_ical,
              disposition: "attachment; filename=#{ics_filename}",
              content_type: "text/calendar"
  end
end