SlideShare a Scribd company logo
1 of 50
RoR: What is it Good
For?
Absolutely Something
Ruby vs. Rails
Ruby Rails
Is it the Only Game in Town?
Is it the Only Game in Town?
If Rails is the Creature
▪ David Heinemeier Hansson
(DHH)
▪ Drives racecars
▪ Created Rails for speed, self-
reliance, and programmer
happiness
▪ "If we don't have toys, we're
just adults."
MVC Architecture
Architecture (n): the action or process of building; construction
What Does MVC Stand For Anyway?
M
V
C
What Does MVC Stand For Anyway?
Model
V
C
What Does MVC Stand For Anyway?
Model
View
C
What Does MVC Stand For Anyway?
Model
View
Controller
View
View
View
▪ What a user sees
▪ .ERB (embedded ruby) files as
default
– Mixes Ruby syntax with HTML
syntax in .html.erb files
But Wait, There’s More
▪ Rails provides a number of
helpful additions to your views
– Form helpers
– URL helpers
▪ Partials
– Templates that let you use the
same view section multiple places
– Especially useful for forms
▪ _form.html.erb
Controller
▪ Where the action’s at
▪ Receives requests for the
application
▪ Determines what information
the view should display
▪ Sends commands to the model
to change/update any data
▪ Ruby (.rb) file
Model
▪ Determines how data is stored
and structured
▪ Less about the action, more
about the inherent nature or
state of the information
▪ Ruby (.rb) file
All About That (Data)base
Database Migrations
▪ Ruby classes that are designed
to make it simple to create and
modify database tables
▪ automatically generated when
you generate a model
– Can be generated separately
▪ create the database tables
when run
Relationships
▪ Declared in the models
▪ One to one
– Users and social media profiles
▪ A user only has_one Facebook profile, and that profile only belongs_to that user
▪ One to many
– Users and orders
▪ A user has_many orders, and each order only belongs_to that user
▪ Many to many
– Writing prompts and categories
▪ Categories can contain many prompts, and those prompts can belong to many categories
– Join table prompt_categories
– A prompt has_many :prompt_categories
has_many :categories, through: :prompt_categories
– A prompt category belongs_to prompts AND categories
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Request
Router
Controller
Model
Database
App Flow
View
Controller
Model
Database
App Flow
View
Controller
Model
Database
App Flow
View
Controller
Model
Database
App Flow
View
Controller
Model
Database
Gems
▪ Ruby recap:
– Gems are packaged bits of code
other people have written
▪ Rails is a gem!
▪ People frequently use gems to:
– Handle user authentication
– Write tests for their code
– Separate data chunks into pages
– Create fake data
▪ Gems go in yourGemfile
Who Uses Rails?
Is Rails Good for Everything?
Is Rails Good for Everything?
Katherine McClintic
Web Developer.Teacher. Musician. Fencer. Person
who likes to take things apart and usually puts
them back together in working order-er.
@scarletalphabet
Rails Lead forWomenWho Code DC meetup

More Related Content

What's hot

Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewDiacode
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--devaltsav
 
Internet Marketing Institute in Delhi
Internet Marketing Institute in DelhiInternet Marketing Institute in Delhi
Internet Marketing Institute in DelhiJessica Smith
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Pluginssuperann
 
Site Builders: Let's clean up our UIs!
Site Builders: Let's clean up our UIs!Site Builders: Let's clean up our UIs!
Site Builders: Let's clean up our UIs!cherryhillco
 
Single page application and Framework
Single page application and FrameworkSingle page application and Framework
Single page application and FrameworkChandrasekar G
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better lifeDaniel Lv
 
CSS Grid
CSS GridCSS Grid
CSS Grideystein
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMake & Build
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developerHsuan Fu Lien
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101Eric Sembrat
 
Web design v roku 2013
Web design v roku 2013Web design v roku 2013
Web design v roku 2013vibration.sk
 
新版阿尔法城背后的前端MVC实践
新版阿尔法城背后的前端MVC实践新版阿尔法城背后的前端MVC实践
新版阿尔法城背后的前端MVC实践Dexter Yang
 
How to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressHow to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressGerald Glynn
 
The Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookThe Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookFuture Insights
 

What's hot (20)

Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
Internet Marketing Institute in Delhi
Internet Marketing Institute in DelhiInternet Marketing Institute in Delhi
Internet Marketing Institute in Delhi
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Plugins
 
Site Builders: Let's clean up our UIs!
Site Builders: Let's clean up our UIs!Site Builders: Let's clean up our UIs!
Site Builders: Let's clean up our UIs!
 
Single page application and Framework
Single page application and FrameworkSingle page application and Framework
Single page application and Framework
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better life
 
CSS Grid
CSS GridCSS Grid
CSS Grid
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101
 
Web design v roku 2013
Web design v roku 2013Web design v roku 2013
Web design v roku 2013
 
新版阿尔法城背后的前端MVC实践
新版阿尔法城背后的前端MVC实践新版阿尔法城背后的前端MVC实践
新版阿尔法城背后的前端MVC实践
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Boots and Shoeboxes
Boots and ShoeboxesBoots and Shoeboxes
Boots and Shoeboxes
 
How to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressHow to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPress
 
The Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookThe Future is Modular, Jonathan Snook
The Future is Modular, Jonathan Snook
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMS
 
Word press
Word pressWord press
Word press
 

Viewers also liked

ANDY FLETT TOOLS summary
ANDY FLETT TOOLS summaryANDY FLETT TOOLS summary
ANDY FLETT TOOLS summaryAndy Flett
 
Intro to Ruby/Rails at TechLady Hackathon
Intro to Ruby/Rails at TechLady HackathonIntro to Ruby/Rails at TechLady Hackathon
Intro to Ruby/Rails at TechLady Hackathonkdmcclin
 
PC CERTIFICATION routine
PC CERTIFICATION routinePC CERTIFICATION routine
PC CERTIFICATION routineAndy Flett
 
Basic Active Record
Basic Active RecordBasic Active Record
Basic Active Recordkdmcclin
 
Jerry Angel Report for karyotype & FISH training
Jerry Angel  Report for karyotype & FISH trainingJerry Angel  Report for karyotype & FISH training
Jerry Angel Report for karyotype & FISH trainingJerry Angel
 

Viewers also liked (10)

ANDY FLETT TOOLS summary
ANDY FLETT TOOLS summaryANDY FLETT TOOLS summary
ANDY FLETT TOOLS summary
 
resume
resumeresume
resume
 
Resume
ResumeResume
Resume
 
No.23-D (1)
No.23-D (1)No.23-D (1)
No.23-D (1)
 
IMTAFM
IMTAFMIMTAFM
IMTAFM
 
DukeTalks
DukeTalksDukeTalks
DukeTalks
 
Intro to Ruby/Rails at TechLady Hackathon
Intro to Ruby/Rails at TechLady HackathonIntro to Ruby/Rails at TechLady Hackathon
Intro to Ruby/Rails at TechLady Hackathon
 
PC CERTIFICATION routine
PC CERTIFICATION routinePC CERTIFICATION routine
PC CERTIFICATION routine
 
Basic Active Record
Basic Active RecordBasic Active Record
Basic Active Record
 
Jerry Angel Report for karyotype & FISH training
Jerry Angel  Report for karyotype & FISH trainingJerry Angel  Report for karyotype & FISH training
Jerry Angel Report for karyotype & FISH training
 

Similar to RoR: What is it Good For?: Absolutely Something

Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01sagaroceanic11
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsiradarji
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to railsEvgeniy Hinyuk
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukPivorak MeetUp
 
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...SocialBiz UserGroup
 
Ruby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCRuby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCShay Friedman
 
Ember,js: Hipster Hamster Framework
Ember,js: Hipster Hamster FrameworkEmber,js: Hipster Hamster Framework
Ember,js: Hipster Hamster FrameworkBilly Shih
 
Ruby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET PerspectiveRuby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET PerspectiveBuddy Lindsey
 
Ruby on Rails best resources for self
Ruby on Rails best resources for selfRuby on Rails best resources for self
Ruby on Rails best resources for selfDurga Prasad Tumu
 
Ruby on Rails Primer
Ruby on Rails PrimerRuby on Rails Primer
Ruby on Rails PrimerJay Whiting
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPAGil Fink
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHPGautam Rege
 

Similar to RoR: What is it Good For?: Absolutely Something (20)

Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
RubyonRails
RubyonRailsRubyonRails
RubyonRails
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
 
Ruby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCRuby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVC
 
Ember,js: Hipster Hamster Framework
Ember,js: Hipster Hamster FrameworkEmber,js: Hipster Hamster Framework
Ember,js: Hipster Hamster Framework
 
Ruby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET PerspectiveRuby on Rails from an ASP.NET Perspective
Ruby on Rails from an ASP.NET Perspective
 
Ruby on Rails best resources for self
Ruby on Rails best resources for selfRuby on Rails best resources for self
Ruby on Rails best resources for self
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Ruby on Rails Primer
Ruby on Rails PrimerRuby on Rails Primer
Ruby on Rails Primer
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
NoSQL
NoSQLNoSQL
NoSQL
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
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
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
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
 

RoR: What is it Good For?: Absolutely Something

Editor's Notes

  1. Welcome. I hope you all have enjoyed what you’ve seen and done so far. This talk will give you a taste of some of the topics you’ll see in the tutorial later. There will be plenty of coaches around to help answer questions, and these slides will go up online somewhere, so don’t worry if it seems a little overwhelming at first. Without further ado, Ruby on Rails, RoR, Rails, Ruby/Rails, whatever you want to call it:
  2. You’ve now heard a bit about Ruby. So if what I’m talking to you about is Ruby on Rails, what’s the difference? I like to think of Ruby as the raw ingredients. The flour, the sugar, the fat, and so on. You can make a great cake from scratch. But that takes a lot of time and you risk the possibility of not getting the mix exactly right. That’s where Rails comes in. Rails is a framework for Ruby, so in this analogy it’s sort of the boxed cake mix. It’s still got flour and sugar and so on inside it, but it’s packaged up to be quick easy to use. You can customize it for your own needs, but you don’t have to in order to get a great cake out of it.
  3. With that said, is Rails the only Ruby framework? The only boxed cake mix around?
  4. No, but, and let’s ignore the second one for a moment, it might as well be. It’s so popular compared to the next most popular one that few major companies use anything else. When trying to think of a well known company or organization that does Ruby on another framework, the only one I could come up with is the NSA, for reasons I can theorize later if you’re curious.
  5. So if Rails is the creation, if it’s the creature, who is Dr. Frankenstein? Well, it’s this guy. DHH as he’s known. He looks less like a member of a European boyband now, but this is still the picture of him that most places use, including his own website. Obligatory information: he drives racecars. The reason why Rails is so popular with startups is that it was created to enable small teams or individuals to build with speed, and to enjoy it. A lot like Matz’s goal with Ruby.
  6. We’re going to move to looking at different parts of the Rails skeleton. You don’t need to worry about all or even most of this, this is just to give you an idea of what an app might look like.
  7. Rails is built using an MVC architecture. That may sound intimidating or ominous, but architecture is the same here as it is with buildings. It’s literally the action or process of building—construction. MVC architecture is how you build a Rails app.
  8. First we’re going to take a look at the part that might be most familiar to those of you who’ve done any coding before: the view.
  9. A view is what the user sees in the browser. In Rails you’ll use .erb files by default. This is great because it lets you mix Ruby syntax with your html. Say you have an event app, and you’ve got a Ruby variable set to a collection of upcoming events. In your view you can go through these events and make a list with each event’s name serving as a link to the event.
  10. Like we saw in the last slide, Rails provides some helpful additions for your views, particularly form helpers and url helpers. The url helpers are what let you let the program handle creating a list of links to events instead of writing out each and every link on your own. It translates it into the appropriate html for the browser. This is especially great for when information changes, like a new event is added, so you don’t have to go in a physically add the link yourself. Partials are also helpful for views. They’re basically templates that let you use the same view section in multiple places. Say you’ve got a form to create a new event, where you add the location, the date, the time, and such information. Well that’s pretty much the same thing as an ‘edit my event information’ form, right? So Rails lets you create a partial where you can refer to this form without copy and pasting the whole form wherever you need it.
  11. We’re going to move from the views
  12. To the controllers.
  13. A controller receives requests for certain application actions. This includes determining what information the view should display (creating a new user? Great, let’s show that user’s name with a welcome message once they’ve submitted the form), as well as interacting with the model to change or update any data. You’ve asked the application to create a new user? Great, it meets all requirements so it goes in the database.
  14. So this is the user controller for the event app. The new action is what will connect the new user form in the view with the user model. The create action is what posts the information to the database and then, if it’s saved correctly, sends you to a different page.
  15. So we were on controllers but we still need to talk about one aspect of MVC.
  16. Models. We’ve mentioned them a bit so far.
  17. There’s a couple of things to notice here. 1) database relationships (how tables of information relate to each other) are declared in the models. In this case how a user has many events that they’ve created or could potentially create. 2) Aside from validations like those that force you to have a long and complicated password, there’s nothing here that talks about what user information we’re storing in the database. That’s because Rails follows its usual pattern of assuming you’re following conventions and maps model information from the matching migration.
  18. Which means we need to talk about databases.
  19. Let’s start with database migrations. In Rails they’re just Ruby classes. You can generate them separately from models, but I believe the tutorial will have you do it all as one. This is part of what can make Rails so quick.
  20. The migration details the kind of information that will be stored in the table. In this case each event is going to have a name, a location, a date, and a time. Timestamps are fields that mark when an entry was created, as well as when it was updated (if applicable).
  21. Remember how we saw in the user model that a user has many events? Well the events table is where you store the user id so you know which user created that event.
  22. Let’s get a bit of a closer look at relationships. One to one is probably not something you’ll use a lot, but useful to see. One to many Many to many: say you have a writing prompt about being out in freshly fallen snow. That could fall under the category of winter, nature, weather, or all of the above. Each of those categories could in turn have several other prompts. In this case, because the number of connections on both sides could be anywhere from 1 to infinity – 1, we’re going to need a join table. People have varying opinions on what you should name this join table, but as long as it’s clear, you’re good.
  23. In this case our user has a one-to-many relationship with events. A user may create many events, but a particular event only belongs to one user. This is not considering any guests, just users creating events.
  24. Let’s summarize this all up with some app flow. Say you’ve got a user looking at the awesome web app that you’ve created. What they see in their browser is connected to your view. They think it’s pretty cool, so they want to sign up.
  25. They click on a ‘create account’ link (or similar), which fires off a request to the app.
  26. That request says the programmatic equivalent of “hey, trying to create a new account here.” That hits the router, whose job it is to make sure that request goes to the appropriate place.
  27. The router sends that new user creation request to the controller.
  28. The controller sends that to the model to verify that everything’s on the up and up.
  29. The information then gets sent to the database and stored.
  30. Okay, well how are we getting back to the view?
  31. The information comes back from the database.
  32. It gets passed to the controller. The controller might fire off a particular action if something went wrong (like showing an error message), and another action if it goes right.
  33. In this case we’re going to assume that the new user was successfully created and stored. The controller fires off the success action you wrote and passes the user information to the view, which displays the user’s name at the top of the screen and says, “Welcome, Katherine!”
  34. Gems. Shiny!
  35. Rails is popular with startups like these because it allows a small team or individual to create at least a basic version of an app fairly quickly. So why doesn’t everybody use it?
  36. You may have heard that Twitter was built with Rails. So where Rails falters is in scaling up to handle giant apps where hundreds of thousands of users transmit and save data at any single second.
  37. So Twitter had to move off of Rails. But as you’ve just seen, Rails does a pretty good job for other companies that are household names.
  38. I didn’t want to end this presentation on a downer, so one last piece of nerd/tech humor.