Thursday, February 14, 2008

New Resource for Beginner 2.0 Tutorials

Just found a site with some great video tutorials for beginners. Its RubyPlus.org. You have to create a free account to access the download.

When I first went to learn Ruby, the book unanimously suggested to me was Agile Web Development with Rails. After a quick search I had found out that the tutorials, of course, didn't work with 2.0. A little more searching and I came across RubyPlus. He has the depot app from the book adapted to Rails 2.0, and video tutorials on it. You will need some of the source that came with the book, which can be downloaded here.

After you create your account at RubyPlus, click Archives to see the tutorials. The AWDR depot ones are 19, 22, 27, 28, 29. It looks like there is a lot of good material on this site besides depot tutorials, I plan to spend a lot of time watching Bala's screencasts.

Also, you can find his blog here.

On to the tutorial:

I've finished the first 2 screencasts without too much trouble. He moves pretty fast, and copies/pastes a lot of code when he creates new files, so be ready to pause so you can type everything out.

In the first screencast, we set up the project, created scaffolding, and played around with the view a little. In the second, we created an admin namespace, and then nested a product route under it, changing the controllers and views so that only an admin could add, edit, and destroy books. So far, much like the blog app from the AkitaOnRails site.

There was a point where you needed some images and css files from the AWDR book (link above), and despite what he says on his page, you don't need to buy the book to download it(although I had the book already). There is also a segment in the first screencast where he is creating a bootstrap.rake file to set up automatic population of the database, and the screen cuts off some of the code he pastes into the file, the full contents of the file are:

SITE_DIR = File.join(RAILS_ROOT, 'themes/site-' + (ENV['SITE_ID'] || '1'))
namespace :db do
namespace :bootstrap do
desc "Load initial database fixtures (in db/bootstrap/*.yml) into the current environment's database.
Load specific fixtures using FIXTURES=x,y"
task :load => :environment do
require 'active_record/fixtures'
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'db', 'bootstrap',
'*.{yml,csv}'))).each do |fixture_file|
Fixtures.create_fixtures('db/bootstrap', File.basename(fixture_file, '.*'))
end
end
end
end


See you next time!

No comments: