2011-06-13 22:39:39 +00:00
|
|
|
class RemindersController < ApplicationController
|
|
|
|
respond_to :json
|
|
|
|
|
|
|
|
def create
|
|
|
|
@reminder = Reminder.new(params[:reminder])
|
|
|
|
if @reminder.save
|
2011-09-15 21:41:26 +00:00
|
|
|
ThingMailer.reminder_email(@reminder.thing).deliver
|
2011-06-25 09:38:00 +00:00
|
|
|
@reminder.update_attribute(:sent, true)
|
2011-06-13 22:39:39 +00:00
|
|
|
render(:json => @reminder)
|
|
|
|
else
|
|
|
|
render(:json => {"errors" => @reminder.errors}, :status => 500)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|