- update database YML file with
production: adapter: postgresql encoding: unicode database: whatsat_production pool: 5 password:
- remove unneeded gems
adding this to your javasript will allow you to initiate the debugger on demand, no matter where you arein your code by entering into the console window.ohNo | |
var window.ohNo = function(){ | |
debugger; | |
}; | |
genius! |
production: adapter: postgresql encoding: unicode database: whatsat_production pool: 5 password:
raise params.inspect |
PAPER - work out what form all of your data will take- tables and field names
TERMINAL - rails new NAME -d postgresql
TERMINAL - cd into that NAME folder and subl .
SUBL - open your gemfile and add all the extra gems you want
eg. debugging gems cos they're awesome:
all goodness starts with a simple line: rails new first_app -d postgresql (where 'first_app' is the folder name of the new app)
then go into the folder and add the basics: rails generate scaffold movie title:string in_theatres:boolean released:date rating:string description:text
go into config/database and chnage the username to match usenrame
back in terminal: rake db:create
then: rake db:migrate
https://gist.github.com/wofockham/1000198e4ae7bed746ae | |
http://guides.rubyonrails.org/association_basics.html | |
to get the search thing going - the hint is 'substring' | |
also make all of this using MVC | |
wil require an associations db | |
book id | author id |
First make sure you have created your Gemfile and config.ru
Gemfile should contain something like:
source "http://rubygems.org" gem 'sinatra' group :development do gem 'pry' end
# require "pry" | |
us=["Simon","Anne","Olly","Kriss","Nix","Tom","Erik","Charlie","Mark"].shuffle | |
print "How many people per group? " | |
group = gets.chomp.to_i | |
remainder = us.length % group | |
groups_total = (us.length - remainder)/group |
#"Day" 2.to_s
##Yesterday we were about
###Ruby
# Building Ruby Familiarity | |
# In this exercise you will take a first look at some common commands in Ruby | |
# The idea here is to build familiary with Ruby syntax | |
# This will likely be the first time you've seen some of these commands | |
# Just type them in and see the displayed output | |
# Steps: | |
# 1. Open up a new terminal window | |
# 2. Launch irb |