Skip to content
This repository
tree: d313d707b2
Fetching contributors…

Cannot retrieve contributors at this time

file 14 lines (13 sloc) 0.387 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class RemindersController < ApplicationController
  respond_to :json

  def create
    @reminder = Reminder.new(params[:reminder])
    if @reminder.save
      ThingMailer.reminder_email(@reminder.thing).deliver
      @reminder.update_attribute(:sent, true)
      render(:json => @reminder)
    else
      render(:json => {"errors" => @reminder.errors}, :status => 500)
    end
  end
end
Something went wrong with that request. Please try again.