[ Launch: Green Button Data ] 8941619 by rosiehoyem
This file contains 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
#API Best Practices | |
##Routes | |
Restricting Routes | |
resources :zombies, only: [:index, :show] | |
resources :humans, except: [:destroy, :edit, :update] | |
##Subdomain | |
Keeping our API under its own subdomain allows load balancing traffic at the DNS level. | |
resources :zombies, constraints: { subdomain: 'api' } | |
resources :humans, constraints: { subdomain: 'api' } |
This file contains 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 Person < ActiveRecord::Base | |
... | |
def destroy_door_access | |
if self.door_accesses.first | |
self.door_accesses.first.destroy | |
else | |
true | |
end |
This file contains 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
# /app/models/digitize_step | |
class DigitizeStep < ActiveRecord::Base | |
belongs_to :process_step | |
end |
This file contains 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
# /app/controllers/digitize_steps_controller.rb | |
... | |
responds_to :js | |
... | |
def form | |
end | |
... |
This file contains 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
# Description: | |
# Forgetful? Add reminders | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
This file contains 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
source 'https://rubygems.org' | |
gem 'rails', '4.1.1' | |
gem 'pg' | |
gem 'sass-rails', '~> 4.0.3' | |
gem 'uglifier', '>= 1.3.0' | |
gem 'coffee-rails', '~> 4.0.0' | |
gem 'therubyracer', platforms: :ruby | |
gem 'devise' |
This file contains 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 CheckoutsController < ApplicationController | |
... | |
def create | |
@checkout = @item.checkouts.build(checkout_params) | |
respond_to do |format| | |
if @checkout.save | |
if @checkout.reservation == true | |
@checkout.create_activity :reservation, options = { owner: Person.find(@checkout.checked_out_by), recipient: @item, approved_by_id: @user.id } | |
else |
This file contains 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
Name: Rosie Hoyem | |
Github: http://github.com/rosalita | |
Blog: http://rosiehoyem.com/ | |
Tagline: Urbanist, Energy Wonk, Programmer | |
Profile Picture: http://nyobetabeat.files.wordpress.com/2012/09/avi_026-1.jpg | |
Treehouse Account: http://teamtreehouse.com/rosiehoyem | |
CoderWall Account: https://coderwall.com/rosalita | |
CodeSchool Account: http://www.codeschool.com/users/rosalita | |
Favorite Websites: |
This file contains 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
1. Begin by picking up the peanut butter containing and grasp the metal lid. Turn it is a counter clockwise direction until it is dislodged from the container. Place the open jar and cover on the table. | |
2. Repeat step 1 with the jam jar. | |
3. Gently grasp the open end of the bread bag an remove the plastic closing mechanism. | |
4. Reach inside the bag and remove two precut sections, or slices, of the bread substance. | |
5. Place the two slices of bread slide by side, broad faces down on the plate. | |
6. Take the knife (the skinny metal object approximately 8 inches long) and insert it into the open peanut butter jar 2 inches, then tilt it to an angle of 30 degrees. | |
7. Remove the knife and some of the peanut butter material. | |
8. Light press the flat side of the knift to the large face of one of the pieces of bread gently move the knift paralel to the bread, smearing the peanut butter material over the full face to a depth of between 1/8 to 1/4 inch in thickness. | |
Repeat step X with the jam jar and the other piece of bread |
OlderNewer