SlideShare ist ein Scribd-Unternehmen logo
1 von 109
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
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
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, Authenticating Users, Heroku, Capistrano,
Security/Performance, Tuning, Pagination, Email in Rails, Eager Loading,
Background Tasks, Unit Testing, Internationalization & Localization ...
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
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)
- Basecamp
- Slideshare
- Pakwheels
- Github
- YellowPages
Ruby on Rails – (few) Practitioner in Pakistan
- Confiz Limited
- Nextbridge
- Arbisoft
- Tkxel
- PITB
- Kwanso
- 7vals
- Venexel
…..
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
Ruby
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
Environment
Setup
(RVM)
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
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 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
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
Routes
Controllers
Model
Views
Debugging
/
Error Handling
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
Caching
Console
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.
Questions ?

Weitere ähnliche Inhalte

Was ist angesagt?

The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendSpike Brehm
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails IntroductionThomas Fuchs
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS DebuggingRami Sayar
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Rails Engine :: modularize you app
Rails Engine :: modularize you appRails Engine :: modularize you app
Rails Engine :: modularize you appMuntasim Ahmed
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
 
The Guardian Open Platform Content API: Implementation
The Guardian Open Platform Content API: ImplementationThe Guardian Open Platform Content API: Implementation
The Guardian Open Platform Content API: ImplementationThe Guardian Open Platform
 
API Development with Laravel
API Development with LaravelAPI Development with Laravel
API Development with LaravelMichael Peacock
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingDan Davis
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingChristopher Pecoraro
 

Was ist angesagt? (20)

The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Rails Concept
Rails ConceptRails Concept
Rails Concept
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Rails Engine :: modularize you app
Rails Engine :: modularize you appRails Engine :: modularize you app
Rails Engine :: modularize you app
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
 
The Guardian Open Platform Content API: Implementation
The Guardian Open Platform Content API: ImplementationThe Guardian Open Platform Content API: Implementation
The Guardian Open Platform Content API: Implementation
 
API Development with Laravel
API Development with LaravelAPI Development with Laravel
API Development with Laravel
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routing
 

Ähnlich wie Ruby on Rails workshop for beginner

Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails BasicsAmit Solanki
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with DockerMariaDB plc
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09Michael Neale
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Railsg3ppy
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyRobert Dempsey
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web DevelopmentSonia Simi
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsanides
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction Tran Hung
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman OrtegaIntroduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortegaarman o
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesUdita Plaha
 
Instruments ruby on rails
Instruments ruby on railsInstruments ruby on rails
Instruments ruby on railspmashchak
 
Beginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsBeginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsVictor Porof
 

Ähnlich wie Ruby on Rails workshop for beginner (20)

Dev streams2
Dev streams2Dev streams2
Dev streams2
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Ruby on Rails
Ruby on Rails Ruby on Rails
Ruby on Rails
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Rails
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with Ruby
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web Development
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction
 
Ruby on rails for beginers
Ruby on rails for beginersRuby on rails for beginers
Ruby on rails for beginers
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman OrtegaIntroduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails Slides
 
Instruments ruby on rails
Instruments ruby on railsInstruments ruby on rails
Instruments ruby on rails
 
Beginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsBeginners' guide to Ruby on Rails
Beginners' guide to Ruby on Rails
 

Mehr von Umair Amjad

Automated Process for Auditng in Agile - SCRUM
Automated Process for Auditng in Agile - SCRUMAutomated Process for Auditng in Agile - SCRUM
Automated Process for Auditng in Agile - SCRUMUmair Amjad
 
Data Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsData Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsUmair Amjad
 
Bead–Sort :: A Natural Sorting Algorithm
Bead–Sort :: A Natural Sorting AlgorithmBead–Sort :: A Natural Sorting Algorithm
Bead–Sort :: A Natural Sorting AlgorithmUmair Amjad
 
Apache logs monitoring
Apache logs monitoringApache logs monitoring
Apache logs monitoringUmair Amjad
 
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsExact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsUmair Amjad
 
SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7Umair Amjad
 
SQL WORKSHOP::Lecture 6
SQL WORKSHOP::Lecture 6SQL WORKSHOP::Lecture 6
SQL WORKSHOP::Lecture 6Umair Amjad
 
SQL WORKSHOP::Lecture 5
SQL WORKSHOP::Lecture 5SQL WORKSHOP::Lecture 5
SQL WORKSHOP::Lecture 5Umair Amjad
 
SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4Umair Amjad
 
SQL WORKSHOP::Lecture 13
SQL WORKSHOP::Lecture 13SQL WORKSHOP::Lecture 13
SQL WORKSHOP::Lecture 13Umair Amjad
 
SQL WORKSHOP::Lecture 12
SQL WORKSHOP::Lecture 12SQL WORKSHOP::Lecture 12
SQL WORKSHOP::Lecture 12Umair Amjad
 
SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11Umair Amjad
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10Umair Amjad
 
SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9Umair Amjad
 
SQL WORKSHOP::Lecture 3
SQL WORKSHOP::Lecture 3SQL WORKSHOP::Lecture 3
SQL WORKSHOP::Lecture 3Umair Amjad
 
SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2Umair Amjad
 
SQL WORKSHOP::Lecture 1
SQL WORKSHOP::Lecture 1SQL WORKSHOP::Lecture 1
SQL WORKSHOP::Lecture 1Umair Amjad
 
DCT based Watermarking technique
DCT based Watermarking techniqueDCT based Watermarking technique
DCT based Watermarking techniqueUmair Amjad
 
Multi-core processor and Multi-channel memory architecture
Multi-core processor and Multi-channel memory architectureMulti-core processor and Multi-channel memory architecture
Multi-core processor and Multi-channel memory architectureUmair Amjad
 
Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Umair Amjad
 

Mehr von Umair Amjad (20)

Automated Process for Auditng in Agile - SCRUM
Automated Process for Auditng in Agile - SCRUMAutomated Process for Auditng in Agile - SCRUM
Automated Process for Auditng in Agile - SCRUM
 
Data Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsData Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvements
 
Bead–Sort :: A Natural Sorting Algorithm
Bead–Sort :: A Natural Sorting AlgorithmBead–Sort :: A Natural Sorting Algorithm
Bead–Sort :: A Natural Sorting Algorithm
 
Apache logs monitoring
Apache logs monitoringApache logs monitoring
Apache logs monitoring
 
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in RoboticsExact Cell Decomposition of Arrangements used for Path Planning in Robotics
Exact Cell Decomposition of Arrangements used for Path Planning in Robotics
 
SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7
 
SQL WORKSHOP::Lecture 6
SQL WORKSHOP::Lecture 6SQL WORKSHOP::Lecture 6
SQL WORKSHOP::Lecture 6
 
SQL WORKSHOP::Lecture 5
SQL WORKSHOP::Lecture 5SQL WORKSHOP::Lecture 5
SQL WORKSHOP::Lecture 5
 
SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4
 
SQL WORKSHOP::Lecture 13
SQL WORKSHOP::Lecture 13SQL WORKSHOP::Lecture 13
SQL WORKSHOP::Lecture 13
 
SQL WORKSHOP::Lecture 12
SQL WORKSHOP::Lecture 12SQL WORKSHOP::Lecture 12
SQL WORKSHOP::Lecture 12
 
SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10
 
SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9
 
SQL WORKSHOP::Lecture 3
SQL WORKSHOP::Lecture 3SQL WORKSHOP::Lecture 3
SQL WORKSHOP::Lecture 3
 
SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2
 
SQL WORKSHOP::Lecture 1
SQL WORKSHOP::Lecture 1SQL WORKSHOP::Lecture 1
SQL WORKSHOP::Lecture 1
 
DCT based Watermarking technique
DCT based Watermarking techniqueDCT based Watermarking technique
DCT based Watermarking technique
 
Multi-core processor and Multi-channel memory architecture
Multi-core processor and Multi-channel memory architectureMulti-core processor and Multi-channel memory architecture
Multi-core processor and Multi-channel memory architecture
 
Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Migration from Rails2 to Rails3
Migration from Rails2 to Rails3
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
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
  • 3. Why I am here?
  • 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. 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. Why Ruby on Rails?
  • 7. Why Ruby on Rails? http://www.payscale.com/research/US/Skill=Ruby_on_Rails/Hourly_Rate
  • 8. Ruby on Rails - Users - Amazon (internal) - Intel (internal) - HP (internal) - NASA (internal) - Twitter (in early age) - Basecamp - Slideshare - Pakwheels - Github - YellowPages
  • 9. Ruby on Rails – (few) Practitioner in Pakistan - Confiz Limited - Nextbridge - Arbisoft - Tkxel - PITB - Kwanso - 7vals - Venexel …..
  • 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. Ruby
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 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
  • 23. 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
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 34.
  • 35.
  • 36.
  • 38.
  • 40.
  • 42.
  • 43.
  • 44.
  • 46. Rake
  • 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
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Model
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86. Views
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 99.
  • 100.
  • 101. 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
  • 103.
  • 104.
  • 105.
  • 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.
  • 108.