SlideShare a Scribd company logo
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Introduction to Web
Development
With Ruby on Rails
Panos G. Matsinopoulos
Tech Career Booster
techcareerbooster.com
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Who am I?
● Panos G. Matsinopoulos
● Software Writer and Reader
● Computer Programming Proponent (techcareerbooster.com)
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
What is a Computer Program?
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
What is a Programming Language?
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
What is Web Development?
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Web Development
● Application that is used using a Web Browser
● Implementation relies on HTTP …
● … which relies on TCP…
● … which relies on IP …
● Other protocols are popular
● … SMTP
● … FTP
● … and more …
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Do I have to Learn Internet Protocols?
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
HTTP(S)
● Used by browser to issue a request to a Web server.
● Verb (GET, POST, PUT, PATCH, DELETE …)
● URI (“http://foo.bar.com/articles”)
● Headers
● Body
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
HTTP Request / HTTP Response
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Ruby on Rails - Web Framework
● Has solved many of the Technology Challenges
● Allows you to focus on the Application / Business Domain
● For example
○ Allows you to easily parse the values that are submitted using a form
○ Has solved many security concerns.
○ e.t.c.
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Prerequisites for RoR
● HTML, CSS (SASS), JavaScript (Coffee)
● HTTP Basics
● SQL and Database Design
● Ruby
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Rails Server
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Routes
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Route Decision
HTTP VERB PATH TO RESOURCE
GET /articles route to
GET /articles/ruby-hashes
Controller &
Action
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Routes Configuration
get '/reset_password_request', to: 'reset_passwords#new', as: :reset_password_request
post '/reset_password_request', to: 'reset_passwords#create', as: :create_reset_password_request
get '/reset_password', to: 'reset_passwords#new_reset_password', as: :new_reset_password
post '/reset_password', to: 'reset_passwords#reset_password', as: :reset_password
HTTP Verbs Controllers Actions
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Controllers & Actions
● A Controller is an Object.
● An Action is a public method on this Controller.
● It takes the data of the HTTP request.
● It does the job requested.
● It prepares the data for the View.
● Asks view to build up the response.
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Controller Example
class ArticlesController < ApplicationController
def create
article = Article.new(article_params)
if article.save
flash[:success] = 'Article has been created!'
redirect_to edit_article_url(article)
else
@article = article
render :new
end
end
# ...
end
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
What are the Models?
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Models more like this:
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Models in RoR
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Persist Model State
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
RoR Favours RDBMS
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Objects <=>Tables
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
ActiveRecord
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Controller Example - Model Highlights
class ArticlesController < ApplicationController
def create
article = Article.new(article_params)
if article.save
flash[:success] = 'Article has been created!'
redirect_to edit_article_url(article)
else
@article = article
render :new
end
end
# ...
end
Model and ActiveRecord
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Views and Layouts
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Layout Example
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<title>Blog</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body>
<div class="container">
<%= render partial: 'layouts/flash' %>
<%= yield %>
</div>
</body>
</html>
This is where the view part is embedded in
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
View Example
<% # File: app/views/articles/new.html.erb %>
<h1>Create a New Article</h1>
<%= form_for @article, url: articles_path do |f| %>
<div class="form-group">
<%= f.label :title %>
<%= f.text_field :title, placeholder: 'Give Title of Article', class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :text %>
<%= f.text_area :text, placeholder: 'Type in the text of the Article', class: 'form-control' %>
</div>
<div>
<%= f.submit class: 'btn btn-success' %>
</div>
<% end %>
<div class="text-right">
<a href="<%= articles_path %>">List of Articles</a>
</div>
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
6 Basic Architecture Components
● Ruby on Rails Server
● Routes
● Controllers (and their Actions)
● Models
● Views
● Assets
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Assets
● Images
● JavaScript
● CSS
● Minification
● Fingerprint (which helps browser caching the resources)
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
Folder Structure
Tech Career Booster - Online Computer Programming School - techcareerbooster.com
You’ve had enough of me ….
Want to land on a
Junior Web Developer job? …
Learn how by clicking this:
techcareerbooster.com
Ad

Recommended

Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
Konstantin Gredeskoul
 
EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?
Andrew Mleczko
 
The PRPL Pattern
The PRPL Pattern
Red Pill Now
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
Roberto Cortez
 
Better and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and Enjoyment
Chris Holland
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks Comparison
Hamed Hatami
 
Monitoring 改造計畫:流程觀點
Monitoring 改造計畫:流程觀點
William Yeh
 
Wrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web Applications
Ryan Roemer
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
Matt Raible
 
有了 Agile,為什麼還要有 DevOps?
有了 Agile,為什麼還要有 DevOps?
William Yeh
 
GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
Maven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
 
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
Simplilearn
 
Big rewrites without big risks
Big rewrites without big risks
Flavius Stef
 
TechSEO Boost 2018: Programming Basics for SEOs
TechSEO Boost 2018: Programming Basics for SEOs
Catalyst
 
Cross-Platform Mobile Chemistry Apps
Cross-Platform Mobile Chemistry Apps
Richard Apodaca
 
Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013
Matt Raible
 
MWLUG - Universal Java
MWLUG - Universal Java
Philippe Riand
 
The Future Of Web Frameworks
The Future Of Web Frameworks
Matt Raible
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
juvenxu
 
Selenium at STPCon - Dallas 2011
Selenium at STPCon - Dallas 2011
hugs
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
Katie Chin
 
Web Frameworks of the Future
Web Frameworks of the Future
elliando dias
 
Developing Java Web Applications
Developing Java Web Applications
hchen1
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Alvaro Sanchez-Mariscal
 
How to Build a Better JIRA Add-on
How to Build a Better JIRA Add-on
Atlassian
 
Play Framework vs Grails Smackdown - JavaOne 2013
Play Framework vs Grails Smackdown - JavaOne 2013
Matt Raible
 
Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!
VMware Tanzu
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
document object model in web technologies notes for engineering.pptx
document object model in web technologies notes for engineering.pptx
manju451965
 

More Related Content

What's hot (20)

Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
Matt Raible
 
有了 Agile,為什麼還要有 DevOps?
有了 Agile,為什麼還要有 DevOps?
William Yeh
 
GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
Maven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
 
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
Simplilearn
 
Big rewrites without big risks
Big rewrites without big risks
Flavius Stef
 
TechSEO Boost 2018: Programming Basics for SEOs
TechSEO Boost 2018: Programming Basics for SEOs
Catalyst
 
Cross-Platform Mobile Chemistry Apps
Cross-Platform Mobile Chemistry Apps
Richard Apodaca
 
Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013
Matt Raible
 
MWLUG - Universal Java
MWLUG - Universal Java
Philippe Riand
 
The Future Of Web Frameworks
The Future Of Web Frameworks
Matt Raible
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
juvenxu
 
Selenium at STPCon - Dallas 2011
Selenium at STPCon - Dallas 2011
hugs
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
Katie Chin
 
Web Frameworks of the Future
Web Frameworks of the Future
elliando dias
 
Developing Java Web Applications
Developing Java Web Applications
hchen1
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Alvaro Sanchez-Mariscal
 
How to Build a Better JIRA Add-on
How to Build a Better JIRA Add-on
Atlassian
 
Play Framework vs Grails Smackdown - JavaOne 2013
Play Framework vs Grails Smackdown - JavaOne 2013
Matt Raible
 
Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!
VMware Tanzu
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
Matt Raible
 
有了 Agile,為什麼還要有 DevOps?
有了 Agile,為什麼還要有 DevOps?
William Yeh
 
GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
Maven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
 
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
Simplilearn
 
Big rewrites without big risks
Big rewrites without big risks
Flavius Stef
 
TechSEO Boost 2018: Programming Basics for SEOs
TechSEO Boost 2018: Programming Basics for SEOs
Catalyst
 
Cross-Platform Mobile Chemistry Apps
Cross-Platform Mobile Chemistry Apps
Richard Apodaca
 
Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013
Matt Raible
 
MWLUG - Universal Java
MWLUG - Universal Java
Philippe Riand
 
The Future Of Web Frameworks
The Future Of Web Frameworks
Matt Raible
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
juvenxu
 
Selenium at STPCon - Dallas 2011
Selenium at STPCon - Dallas 2011
hugs
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
Katie Chin
 
Web Frameworks of the Future
Web Frameworks of the Future
elliando dias
 
Developing Java Web Applications
Developing Java Web Applications
hchen1
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Alvaro Sanchez-Mariscal
 
How to Build a Better JIRA Add-on
How to Build a Better JIRA Add-on
Atlassian
 
Play Framework vs Grails Smackdown - JavaOne 2013
Play Framework vs Grails Smackdown - JavaOne 2013
Matt Raible
 
Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!
VMware Tanzu
 

Similar to Introduction to Web Development with Ruby on Rails (20)

C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
document object model in web technologies notes for engineering.pptx
document object model in web technologies notes for engineering.pptx
manju451965
 
Get going with CakePHP Framework at gnuNify 2010
Get going with CakePHP Framework at gnuNify 2010
Abbas Ali
 
MCA-202-W4-L1.pptx
MCA-202-W4-L1.pptx
manju451965
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
guestf7bc30
 
django_introduction20141030
django_introduction20141030
Kevin Wu
 
An Introduction to Web Components
An Introduction to Web Components
Red Pill Now
 
Client Side Measurement & Performance With Rails
Client Side Measurement & Performance With Rails
Eric Falcao
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
Framework Presentation
Framework Presentation
rmalik2
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
Matt Raible
 
T5 Oli Aro
T5 Oli Aro
Javier Toledo
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter Bootstrap
Marcio Marinho
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
JAX London
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack Development
Mike Taylor
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
ASP.NET - Ivan Marković
ASP.NET - Ivan Marković
Software StartUp Academy Osijek
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
Paul Redmond
 
AngularJS for Web and Mobile
AngularJS for Web and Mobile
Rocket Software
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
document object model in web technologies notes for engineering.pptx
document object model in web technologies notes for engineering.pptx
manju451965
 
Get going with CakePHP Framework at gnuNify 2010
Get going with CakePHP Framework at gnuNify 2010
Abbas Ali
 
MCA-202-W4-L1.pptx
MCA-202-W4-L1.pptx
manju451965
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
guestf7bc30
 
django_introduction20141030
django_introduction20141030
Kevin Wu
 
An Introduction to Web Components
An Introduction to Web Components
Red Pill Now
 
Client Side Measurement & Performance With Rails
Client Side Measurement & Performance With Rails
Eric Falcao
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
Framework Presentation
Framework Presentation
rmalik2
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
Matt Raible
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter Bootstrap
Marcio Marinho
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
JAX London
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack Development
Mike Taylor
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
Paul Redmond
 
AngularJS for Web and Mobile
AngularJS for Web and Mobile
Rocket Software
 
Ad

Recently uploaded (20)

EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Ad

Introduction to Web Development with Ruby on Rails

  • 1. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Introduction to Web Development With Ruby on Rails Panos G. Matsinopoulos Tech Career Booster techcareerbooster.com
  • 2. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Who am I? ● Panos G. Matsinopoulos ● Software Writer and Reader ● Computer Programming Proponent (techcareerbooster.com)
  • 3. Tech Career Booster - Online Computer Programming School - techcareerbooster.com What is a Computer Program?
  • 4. Tech Career Booster - Online Computer Programming School - techcareerbooster.com What is a Programming Language?
  • 5. Tech Career Booster - Online Computer Programming School - techcareerbooster.com What is Web Development?
  • 6. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Web Development ● Application that is used using a Web Browser ● Implementation relies on HTTP … ● … which relies on TCP… ● … which relies on IP … ● Other protocols are popular ● … SMTP ● … FTP ● … and more …
  • 7. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Do I have to Learn Internet Protocols?
  • 8. Tech Career Booster - Online Computer Programming School - techcareerbooster.com HTTP(S) ● Used by browser to issue a request to a Web server. ● Verb (GET, POST, PUT, PATCH, DELETE …) ● URI (“http://foo.bar.com/articles”) ● Headers ● Body
  • 9. Tech Career Booster - Online Computer Programming School - techcareerbooster.com HTTP Request / HTTP Response
  • 10. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Ruby on Rails - Web Framework ● Has solved many of the Technology Challenges ● Allows you to focus on the Application / Business Domain ● For example ○ Allows you to easily parse the values that are submitted using a form ○ Has solved many security concerns. ○ e.t.c.
  • 11. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Prerequisites for RoR ● HTML, CSS (SASS), JavaScript (Coffee) ● HTTP Basics ● SQL and Database Design ● Ruby
  • 12. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 13. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 14. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Rails Server
  • 15. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 16. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Routes
  • 17. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Route Decision HTTP VERB PATH TO RESOURCE GET /articles route to GET /articles/ruby-hashes Controller & Action
  • 18. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Routes Configuration get '/reset_password_request', to: 'reset_passwords#new', as: :reset_password_request post '/reset_password_request', to: 'reset_passwords#create', as: :create_reset_password_request get '/reset_password', to: 'reset_passwords#new_reset_password', as: :new_reset_password post '/reset_password', to: 'reset_passwords#reset_password', as: :reset_password HTTP Verbs Controllers Actions
  • 19. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 20. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Controllers & Actions ● A Controller is an Object. ● An Action is a public method on this Controller. ● It takes the data of the HTTP request. ● It does the job requested. ● It prepares the data for the View. ● Asks view to build up the response.
  • 21. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Controller Example class ArticlesController < ApplicationController def create article = Article.new(article_params) if article.save flash[:success] = 'Article has been created!' redirect_to edit_article_url(article) else @article = article render :new end end # ... end
  • 22. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 23. Tech Career Booster - Online Computer Programming School - techcareerbooster.com What are the Models?
  • 24. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Models more like this:
  • 25. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Models in RoR
  • 26. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Persist Model State
  • 27. Tech Career Booster - Online Computer Programming School - techcareerbooster.com RoR Favours RDBMS
  • 28. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Objects <=>Tables
  • 29. Tech Career Booster - Online Computer Programming School - techcareerbooster.com ActiveRecord
  • 30. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Controller Example - Model Highlights class ArticlesController < ApplicationController def create article = Article.new(article_params) if article.save flash[:success] = 'Article has been created!' redirect_to edit_article_url(article) else @article = article render :new end end # ... end Model and ActiveRecord
  • 31. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 32. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Views and Layouts
  • 33. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Layout Example <!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>Blog</title> <%= csrf_meta_tags %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> </head> <body> <div class="container"> <%= render partial: 'layouts/flash' %> <%= yield %> </div> </body> </html> This is where the view part is embedded in
  • 34. Tech Career Booster - Online Computer Programming School - techcareerbooster.com View Example <% # File: app/views/articles/new.html.erb %> <h1>Create a New Article</h1> <%= form_for @article, url: articles_path do |f| %> <div class="form-group"> <%= f.label :title %> <%= f.text_field :title, placeholder: 'Give Title of Article', class: 'form-control' %> </div> <div class="form-group"> <%= f.label :text %> <%= f.text_area :text, placeholder: 'Type in the text of the Article', class: 'form-control' %> </div> <div> <%= f.submit class: 'btn btn-success' %> </div> <% end %> <div class="text-right"> <a href="<%= articles_path %>">List of Articles</a> </div>
  • 35. Tech Career Booster - Online Computer Programming School - techcareerbooster.com 6 Basic Architecture Components ● Ruby on Rails Server ● Routes ● Controllers (and their Actions) ● Models ● Views ● Assets
  • 36. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Assets ● Images ● JavaScript ● CSS ● Minification ● Fingerprint (which helps browser caching the resources)
  • 37. Tech Career Booster - Online Computer Programming School - techcareerbooster.com Folder Structure
  • 38. Tech Career Booster - Online Computer Programming School - techcareerbooster.com You’ve had enough of me …. Want to land on a Junior Web Developer job? … Learn how by clicking this: techcareerbooster.com