Guard watches a directory and runs commands when it sees changes to files.
This is great for automating your rspec tests!
Add guard
and guard-rspec
to your Gemfile
require 'active_record' | |
ActiveRecord::Base.logger = Logger.new( STDOUT ) | |
ActiveRecord::Base.establish_connection( | |
adapter: 'postgresql', | |
host: 'localhost', | |
username: 'jay', | |
database: 'food_db', | |
port: 5432 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
</body> | |
</html> |
<form action="" method="post"> | |
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>"> | |
</form> |
development: &defaults | |
adapter: postgresql | |
encoding: unicode | |
pool: 5 | |
host: localhost | |
username: <%= `echo $USER`.chomp %> | |
password: | |
database: <%= File.basename(Rails.root) %>_development | |
test: |
# 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: |
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 |
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.1.0' | |
# Use postgresql as the database for Active Record | |
gem 'pg' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
________________________________________________________________________ | |
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 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: |