Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Ruby on Rails workshop for beginner
1. Boutique product development company
It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products.
Ruby on Rails - 101
Umair Amjad
http://about.me/umairamjad
2. Who am I?
Umair Amjad
Technical Lead / SSE
(Bayt.com)
(Confiz Limited)
(AboutUs)
BS CS 2006 (FAST-NU)
MS CS 2012 (FAST-NU)
http://about.me/umairamjad
4. What will happen next?
(6 sessions of 4 hours each)
Ruby on Rails 102 (Moderate)
Ruby on Rails 103 (Expert)
Fun with Gems, Authenticating Users, Heroku, Capistrano,
Security/Performance, Tuning, Pagination, Email in Rails, Eager Loading,
Background Tasks, Unit Testing, Internationalization & Localization ...
21. Primary:
http://www.tutorialspoint.com/ruby/index.htm
The Little Book Of Ruby
References:
http://www.codecademy.com/tracks/ruby
http://www.rubyist.net/~slagell/ruby/getstarted.html
http://rubymonk.com/learning/books/1-ruby-primer
Try Ruby online:
http://www.compileonline.com/execute_ruby_online.php
47. Rake is Ruby make, a make-like language written in Ruby.
Rails uses Rake extensively, especially for the innumerable little
administrative tasks necessary when developing database-
backed web applications.
Rake tasks are loaded from the file Rakefile
Rails rake tasks live under /lib/tasks
You can put your own tasks under lib/tasks
bundle exec rake -T
bundle exec rake -T db #See a list of database tasks
48. db: Database
The most common tasks of the db: Rake namespace are migrate
and create, and it will pay off to try out all of the migration rake tasks
(up, down, redo, reset). rake db:version is useful when
troubleshooting, telling you the current version of the database.
rails: Rails-specific tasks
After upgrading Rails, it is useful to run rails:update, which will
update your config and scripts directories, and upgrade your Rails-
specific javascript
rake stats #gives summary statistics about your code
rake routes #lists all your defined routes
rake secret
107. rails console
The console command lets you interact with your Rails application from
the command line. On the underside, rails console uses IRB, so if you've
ever used it, you'll be right at home. This is useful for testing out quick
ideas with code and changing data server-side without touching the
website.
rails dbconsole
rails dbconsole figures out which database you're using and drops you
into whichever command line interface you would use with it (and figures
out the command line parameters to give to it, too!). It supports MySQL,
PostgreSQL, SQLite and SQLite3.