All notes
Rails

Intro

rubyOnRails.org: getting started.

Rails philosophy:

Installation

Rerequisites:

Install development kit. github: development kit.


# Extract develop kits by clicking on the sfx.exe.
cd /path/to/extracted
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
# Test installation
gem install json --platform=ruby

Install rails:


gem install rails
# Install specific version:
gem install rails -v 4.1

rails -v

Debugger

rubyOnRails: debugging.


require "byebug"
byebug
help

l=
l-
l startLine-endLine

b [nnn]
delete [nnn]
info break

where
frame [nnn]

instance_variables
var all/args/const/global/instance/local

# Watch
display varName
undisplay [nnn]

enable/disable breakpoints

# List all active catchpoints:
catch

continue
# Set a one-time breakpoint on line 'n'
continue n
finish [n]

edit [file:n]

FAQ

Find routes

Type "rails c" to enter console, and run:


Rails.application.routes.recognize_path "sthDir/sth"