Skip to content

Instantly share code, notes, and snippets.

https://github.com/oortcloud/unofficial-meteor-faq
@crywolfe
crywolfe / Gemfile
Last active August 29, 2015 14:06
Rails Development Gemfile
group :development, :test do
gem 'pry-rails'
gem 'pry-doc'
gem 'rspec-rails' # rails generate rspec:install
gem 'annotate'
gem 'better_errors'
gem 'binding_of_caller'
gem 'rails-erd'
gem 'awesome_print'
gem 'rails-footnotes', '>= 4.0.0', '<5' # then command line $rails generate rails_footnotes:install

"It's not working!"

  1. Read the ERRORS
  2. Read the LOGS
  3. Output related info with puts and PRINT
  4. Read the DOCS
  5. Ask an EXPERT

Follow this process every time!

----------------------------------------------------------------------
#### 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:
@crywolfe
crywolfe / .travis.yml
Created April 25, 2014 19:15
.travis.yml (use when setting up travis)
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:
________________________________________________________________________
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.
________________________________________________________________________
----------------------------------------------------------------------
Steps for 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 →
- put in: echo $USER in the terminal right after to make sure it works.
3.) rake db:create
4.) Insert ‘gem’ gist for development:
development: &defaults
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
username: <%= `echo $USER`.chomp %>
password:
database: <%= File.basename(Rails.root) %>_development
test:

CONTEXT

WHAT USER STORY YOU ARE WORKING ON:

I am working on the user story "User wants to log in."

WHAT YOU ARE TRYING TO DO:

I am trying to have the user update their profile.

require 'active_record'
ActiveRecord::Base.logger = Logger.new( STDOUT )
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "crywolfe",
:password => "",
:database => "db_"