By Rupert
Posts tagged ruby
Rails Note #2: Links
Nov 2nd
Ruby References
Ruby Quick Reference
http://www.zenspider.com/Languages/Ruby/QuickRef.html
Rails References
Downloadable Rails API with Javascript http://www.railsbrain.com/ (Preferred)
Official Rails API http://api.rubyonrails.org/
GotAPI
http://www.gotapi.com/html
Naming Conventions
RubyOnRails Naming Conventions from ITSignals
http://itsignals.cascadia.com.au/?p=7
RubyOnRails.org TipSheetForBeginners
http://wiki.rubyonrails.org/rails/pages/TipSheetForBeginners
Tutorials
AkitaOnRails: Rails 2.0 First Full Tutorial
http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial
Blogs
AkitaOnRails
http://www.akitaonrails.com
Books
The Ruby Way
http://rubyhacker.com/
Rails Note #1: Getting my feet wet in Ruby On Rails
Nov 2nd
1. Just installed Ruby and Rails on my MacOSX Leopard. The current version of rails is 1.2.6. I wanted to upgrade using gem update –system but it seems like taking forever.. So I did a manual install of ruby, rubygems then rails..
2. The tutorial that I followed was from http://hivelogic.com/articles/2008/02/ruby-rails-leopard
Installation Summary
2.1 ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p286.tar.gz tar -zxvf ruby-1.8.6-p286.tar.gz ./configure make make install
2.2 rubygems
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz tar -zxvf rubygems-1.3.1.tgz ruby setup.rb
2.3 rails
gem install -V rails
2.4 other gems
gem install rubygems-update gem install mongrel gem install capistrano gem install postgres gem install builder
3. Browsed the first few pages of the hilarious http://www.poignantguide.net/ruby
4. Went for a book. Found Simply Rails 2.0 on Boox24x7 and Safari. Added that to my shelf and read chapters 1 – 5 on my first night.
5. Was able to setup database configuration in config/database.yml using Postgres. I have yet to study how oracle works.
6. rake db:migrate is a convenient way of building your database schema without using SQL. Simply Rails 2.0:Chapter 5:Generating a Model introduced inserting records using script/console
7. URL Helpers for Story Resource
stories_path /stories
new_story_path /stories/new
story_path(@story) /stories/1
edit_story_path(@story) /stories/1/edit
Remember to define the route in config/routes.rb
map.resources :users, :categories
8. Naming Conventions

Variables – lowercase letters and words separated by underscores.
i.e name, country_of_origin
DB Table and Column names should follow convention is always pluralised.
i.e users
Classes and Modules – no underscores and each word is capitalized
i.e User, UserCategories
Comments