Skip to content

Instantly share code, notes, and snippets.

View pyrabbit's full-sized avatar

Matthew Orahood pyrabbit

View GitHub Profile
@import url(http://fonts.googleapis.com/css?family=Oswald:400,300);
h2, h3 {
font-family: 'Oswald', sans-serif;
font-weight: 300;
color: #272F32;
}
/* Custom, iPhone Retina */
# config/routes.rb
Rails.application.routes.draw do
resources :responders, except: [:new, :edit, :destroy], defaults: { format: :json }
resources :emergencies, except: [:new, :edit, :destroy], defaults: { format: :json }
match '*path', to: 'application#render_404', as: :render_404, via: :all
end
# app/controllers/emergency_controller.rb
class EmergenciesController < ApplicationController
@pyrabbit
pyrabbit / PossibleAnswerValidator
Created February 14, 2015 03:11
Validating that there are no possible answer duplicates
possible_answer_values = []
record.possible_answers.each do |p|
possible_answer_values.push(p.value)
end
if record.possible_answers.length != possible_answer_values.uniq.length
record.errors[:possible_answers] << "Question contains matching possible answers."
end
App.Router.map ->
@resource "documents", ->
@resource "document",
path: "/:document_slug/:document_id"