This commit is contained in:
2015-09-12 15:37:05 -05:00
commit cb7e47a466
77 changed files with 1374 additions and 0 deletions

0
app/assets/images/.keep Normal file
View File

View File

@ -0,0 +1,16 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

View File

@ -0,0 +1,15 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/

View File

@ -0,0 +1,5 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end

View File

@ -0,0 +1,2 @@
class ChildrenController < ApplicationController
end

View File

@ -0,0 +1,10 @@
class DocsController < ApplicationController
def index
doc = {
name: "sms-pager-api",
documentation: "https://bitbucket.org/markamoser/sms-pager-api"
}.to_json
render json: doc
end
end

View File

@ -0,0 +1,2 @@
class PagesController < ApplicationController
end

View File

@ -0,0 +1,6 @@
class ParentsController < ApplicationController
def index
@parents = Person.just_parents
respond_with @parents
end
end

View File

@ -0,0 +1,2 @@
class StaffController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class UsersController < ApplicationController
end

View File

@ -0,0 +1,2 @@
module ApplicationHelper
end

0
app/mailers/.keep Normal file
View File

0
app/models/.keep Normal file
View File

View File

@ -0,0 +1,10 @@
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title SmsPager
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body
= yield

21
app/workers/sms.rb Normal file
View File

@ -0,0 +1,21 @@
class SmsSender
attr_accessor :from
attr_accessor :to
attr_accessor :message
def initialize args_as_hash
@from = args_as_hash["from"] ||= ENV["twilio_number"]
@to = args_as_hash["to"]
@message = args_as_hash["message"]
end
def send!
twilio.messages.create(from: @from, to: @to, body: @message)
end
private
def twilio
Twilio::REST::Client.new ENV['twilio_sid'], ENV['twilio_token']
end
end