18 lines
404 B
Ruby
18 lines
404 B
Ruby
class RemindersController < ApplicationController
|
|
respond_to :json
|
|
|
|
def create
|
|
puts params[:reminder].inspect
|
|
@reminder = Reminder.new(params[:reminder])
|
|
|
|
if @reminder.save
|
|
render(:json => @reminder)
|
|
else
|
|
render(:json => {"errors" => @reminder.errors}, :status => 500)
|
|
end
|
|
# ReminderMailer.send_reminder
|
|
# @reminder.sent = true
|
|
# @reminder.save!
|
|
end
|
|
end
|