Skip to content

Instantly share code, notes, and snippets.

# README
# pass in this file when creating a rails project
#
# for example:
# rails _3.2.14_ new awesome_app -d postgresql -m ~/kickhash_template.rb
remove_file "README.rdoc"
create_file "README.md", "TODO"
gem_group :development, :test do
Backbone.Collection = {
fetch: function() {
var requestUrl;
if (isAFunction(this.url)) {
requestUrl = this.url();
} else {
requestUrl = this.url;
}
language: ruby
rvm:
- 2.1.0
before_script:
- "sh -e /etc/init.d/xvfb start"
- "export DISPLAY=:99.0"
- "export JASMINE_SPEC_FORMAT=documentation"
env:
- PG_USERNAME='postgres'
script:
----------------------------------------------------------------------
Steps to create Rails App
----------------------------------------------------------------------
1.) rails new app_name -d postgresql
'Jesse's way': rails g model Complaint descriptor:string address:string latitude:decimal longitude:decimal zip:integer
2.) database.yml → 'Phil's gist'
- put in: echo $USER in the terminal right after to make sure it works.
3.) rake db:create
4.) Insert ‘gem’ gist for development:
________________________________________________________________________
GIT HUB WITH PROJECTS
________________________________________________________________________
* git branch -d → Will delete the branch completely if it SUCKS.
* AlWAYS pull first before you start your work.
* git checkout develop → Never work on master branch.
- Your MASTER branch must always work.
________________________________________________________________________
HEROKU STEPS to SET UP:
1. git init
2. git add -A
3. git commit -m “”
4. heroku create
5. heroku keys:add → If there are any.
6. git push heroku master
Put in gemfile:
- rails 12factor gem
@JayK31
JayK31 / Gemfile
Created April 8, 2014 15:32 — forked from phlco/Gemfile
# What about including `pry`, `rspec` or `guard`?
# They're loaded automatically as dependencies
group :development, :test do
# Annotates ActiveRecord Models, routes and others based on the database schema
gem "annotate"
# generates entity relationship diagrams based on Active Record models
# Postscript bugs may be fixed with:

Setting up Guard with Rspec

Guard watches a directory and runs commands when it sees changes to files.

This is great for automating your rspec tests!

Set up

Add guard and guard-rspec to your Gemfile

development: &defaults
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
username: <%= `echo $USER`.chomp %>
password:
database: <%= File.basename(Rails.root) %>_development
test: