This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
protected | |
def current_user | |
@current_user ||= User.find_by_id(session[:user_id]) | |
end | |
def signed_in? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var restify = require("restify"); | |
var users = require("./users"); | |
// The users module will have a getAuthorizationFromAccessTokenAsync promise-returning export. (Convert to callbacks if you wish). | |
// It rejects in cause of not authorized, or fulfills with a { scope, customerId } object if the user is authorized. | |
// The scope property indicates which scopes the user corresponding to a given access token has. | |
module.exports = function authPlugin(serverRequest, serverResponse, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/models/survey.erb | |
class Survey < ActiveRecord::Base | |
has_many :questions, :dependent => :destroy | |
accepts_nested_attributes_for :questions | |
validates_presence_of :name | |
end | |
/models/question.erb | |
class Question < ActiveRecord::Base | |
belongs_to :survey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.background_clip | |
// Seriously, why isn't this just the | |
// freakin' default in all browsers? | |
+background-clip(padding-box) | |
// Not sure what this does? Have a looksie... | |
// http://compass-style.org/examples/compass/css3/background-clip | |
// Crucial, if you have rounded corners on something with | |
// both background color and a border. Without, background |