Boutique product development company
It is amazing what you can accomplish when you have a client-centric team to deliver ...
Who am I?
Umair Amjad
Technical Lead / SSE
(Bayt.com)
(Confiz Limited)
(AboutUs)
BS CS 2006 (FAST-NU)
MS CS 2012 (FAST-NU)...
Why I am here?
What will happen next?
(6 sessions of 4 hours each)
Ruby on Rails 102 (Moderate)
Ruby on Rails 103 (Expert)
Fun with Gems,...
Ruby on Rails Workshop
Agenda:
• Ruby Language
• Environment Setup
• Overview of RoR
• MVC – ActiveRecord, ActionControlle...
Why Ruby on Rails?
Why Ruby on Rails?
http://www.payscale.com/research/US/Skill=Ruby_on_Rails/Hourly_Rate
Ruby on Rails - Users
- Amazon (internal)
- Intel (internal)
- HP (internal)
- NASA (internal)
- Twitter (in early age)
- ...
Ruby on Rails – (few) Practitioner in Pakistan
- Confiz Limited
- Nextbridge
- Arbisoft
- Tkxel
- PITB
- Kwanso
- 7vals
- ...
Nice-to-Have
- Basics of Linux
- Basic knowledge of HTML, CSS, JS
- Databases Relations
- Frameworks
- Client Server Archi...
Ruby
Primary:
http://www.tutorialspoint.com/ruby/index.htm
The Little Book Of Ruby
References:
http://www.codecademy.com/tracks...
Environment
Setup
(RVM)
http://setuprubyonrails.blogspot.com/2012/04/ruby-on-rails-environment-setup-on.html
https://gorails.com/setup/ubuntu/14.1...
Overview of
RoR / MVC
REST
Architecture
Assets
/
Minification
Bundler
Code
Generation
Rails
Rake, Route, Controller, Model, View
Rake
Rake is Ruby make, a make-like language written in Ruby.
Rails uses Rake extensively, especially for the innumerable littl...
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...
Routes
Controllers
Model
Views
Debugging
/
Error Handling
gem install debugger
class PeopleController < ApplicationController
def new
debugger
@person = Person.new
end
end
$ rails ...
Caching
Console
rails console
The console command lets you interact with your Rails application from
the command line. On the underside, r...
Questions ?
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Upcoming SlideShare
Loading in …5
×

Ruby on Rails workshop for beginner

1,887 views

Published on

Overview of RoR
Setting up Environment
Ruby Language
MVC – ActiveRecord, ActionController, ActionView
REST Architecture
Routing
DB Migrations
ActiveRecord Associations
Validation/Validation Helpers
Forms/ActionView helpers
Assets/Bundler
Caching
Debugging
RoR Quick-start Demo

Published in: Technology
2 Comments
6 Likes
Statistics
Notes
No Downloads
Views
Total views
1,887
On SlideShare
0
From Embeds
0
Number of Embeds
92
Actions
Shares
0
Downloads
92
Comments
2
Likes
6
Embeds 0
No embeds

No notes for slide

Ruby on Rails workshop for beginner

  1. 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. 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
  3. 3. Why I am here?
  4. 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 ...
  5. 5. Ruby on Rails Workshop Agenda: • Ruby Language • Environment Setup • Overview of RoR • MVC – ActiveRecord, ActionController, ActionView • Routing • Assets/Bundler • REST Architecture • DB Migrations • Console • ActiveRecord Associations • Logging • Validation/Validation Helpers • Forms/ActionView helpers • Caching • Debugging
  6. 6. Why Ruby on Rails?
  7. 7. Why Ruby on Rails? http://www.payscale.com/research/US/Skill=Ruby_on_Rails/Hourly_Rate
  8. 8. Ruby on Rails - Users - Amazon (internal) - Intel (internal) - HP (internal) - NASA (internal) - Twitter (in early age) - Basecamp - Slideshare - Pakwheels - Github - YellowPages
  9. 9. Ruby on Rails – (few) Practitioner in Pakistan - Confiz Limited - Nextbridge - Arbisoft - Tkxel - PITB - Kwanso - 7vals - Venexel …..
  10. 10. Nice-to-Have - Basics of Linux - Basic knowledge of HTML, CSS, JS - Databases Relations - Frameworks - Client Server Architecture - HTTP methods - MVC (Model View Controller) - ORM (Object-relational mapping) - Cloud Computing
  11. 11. Ruby
  12. 12. 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
  13. 13. Environment Setup (RVM)
  14. 14. http://setuprubyonrails.blogspot.com/2012/04/ruby-on-rails-environment-setup-on.html https://gorails.com/setup/ubuntu/14.10 rvm install [ruby_version] rvm install 1.9.2 rvm use [ruby_version] rvm use 1.9.2 rvm gemset create [gemset_name] rvm gemset create rails3.1.3 rvm use [ruby_version]@[gemset_name] rvm use 1.9.2@rails3.1.3
  15. 15. Overview of RoR / MVC
  16. 16. REST Architecture
  17. 17. Assets / Minification
  18. 18. Bundler
  19. 19. Code Generation
  20. 20. Rails Rake, Route, Controller, Model, View
  21. 21. Rake
  22. 22. 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
  23. 23. 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
  24. 24. Routes
  25. 25. Controllers
  26. 26. Model
  27. 27. Views
  28. 28. Debugging / Error Handling
  29. 29. gem install debugger class PeopleController < ApplicationController def new debugger @person = Person.new end end $ rails server --debugger => Booting WEBrick => Rails 4.0.0 application starting on http://0.0.0.0:3000 => Debugger enabled
  30. 30. Caching
  31. 31. Console
  32. 32. 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.
  33. 33. Questions ?

×