SlideShare a Scribd company logo
1 of 5
Download to read offline
A RAILS APP
How does it work?

@donschado
@klaustopher

Donnerstag, 21. November 13
/

Donnerstag, 21. November 13
/

Donnerstag, 21. November 13
URL
localhost:3000/

Request

GET /

Response
<html lang="en">
<head>
<title>Facebook Lite</title>
<link href="/assets/application.css" media="all" rel="stylesheet">
<script src="/assets/application.js"></script>
</head>
<body>
<div>
<h1>Das Neuste aus dem ganzen Netzwerk</h1>
<ul>
<li>
<img src="https://somewhere.github.com/1062e0f.png">
<div class="media-body">
<h4>Liane<small>19 Nov 20:32</small></h4>
<p>Ich bin hier!!!</p>
</div>
</li>
<li>
<img src="https://somwhere.github.com/fa47a113f69.png">
<div>
<h4>Marco<small>19 Nov 20:02</small></h4>
<p>Hallo, ist da wer?</p>
</div>
</li>
<li>
<img src="https://somwhere.github.com/fa47a113f69.png">
<div>
<h4>Marco<small>19 Nov 19:02</small></h4>
<p>Hallo Welt!</p>
</div>
</li>
</ul>
</div>
</body>
</html>

Router
routes.rb

Controller

	
  	
  <head>
	
  	
  	
  	
  	
  <title>Facebook	
  Lite</title>

	
  	
  	
  	
  	
  <%=	
  javascript_include_tag	
  "application"	
  %>
	
  	
  </head>

Partial

	
  	
  	
  	
  </div>
	
  	
  </body>
</html>

Donnerstag, 21. November 13

Layout
application.html.erb

post.rb

_post.html.erb

class Post < ActiveRecord::Base
end

...	
  </h1>

	
  	
  	
  	
  	
  <%=	
  stylesheet_link_tag	
  	
  	
  	
  "application",	
  media:	
  "all"	
  %>

	
  	
  	
  	
  	
  	
  <%=	
  yield	
  %>

Model

index.html.erb

<ul>
	
  	
  <%=	
  render	
  @posts	
  %>
</ul>

<html	
  lang="en">

	
  	
  	
  	
  <div	
  class="container">

get ’/’ => ‘welcome#index’

welcome_controller.rb

<h1>Das neuste aus

	
  	
  <body>

same as

class WelcomeController < ApplicationController
def index
@posts = Post....
end
end

View

Render
HTML

root ”welcome#index“

<li>
	
  	
  <%=	
  image_tag(post.user.avatar)	
  %>
	
  	
  <%=	
  post.user.name	
  %>
	
  	
  <%=	
  post.content	
  %>
</li>

Datenbank
db/schema.rb
create_table
 t.text
  t.integer
  t.datetime
  t.datetime
end

"posts" do |t|
"content"
"user_id"
"created_at"
"updated_at"
https://github.com/klaustopher/facebook-lite

Donnerstag, 21. November 13

More Related Content

Viewers also liked

Barron gre%5 b1%5d.12th.ed
Barron gre%5 b1%5d.12th.edBarron gre%5 b1%5d.12th.ed
Barron gre%5 b1%5d.12th.ed
Chidananda Naik
 
LA 02 Penyediaan Tanah Nurseri Lanskap
LA 02   Penyediaan Tanah Nurseri LanskapLA 02   Penyediaan Tanah Nurseri Lanskap
LA 02 Penyediaan Tanah Nurseri Lanskap
Muhd Arif Nubli Kenon
 
The Good Doctor by Neil Simon Power Point
The Good Doctor by Neil Simon Power PointThe Good Doctor by Neil Simon Power Point
The Good Doctor by Neil Simon Power Point
annarosemacarthur
 

Viewers also liked (12)

Introductie social media (12 01-2012)
Introductie social media (12 01-2012)Introductie social media (12 01-2012)
Introductie social media (12 01-2012)
 
Ruby's require, autoload and load methods
Ruby's require, autoload and load methodsRuby's require, autoload and load methods
Ruby's require, autoload and load methods
 
76
7676
76
 
Barron gre%5 b1%5d.12th.ed
Barron gre%5 b1%5d.12th.edBarron gre%5 b1%5d.12th.ed
Barron gre%5 b1%5d.12th.ed
 
Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with Rack
 
Rails Girls: Programming, Web Applications and Ruby on Rails
Rails Girls: Programming, Web Applications and Ruby on RailsRails Girls: Programming, Web Applications and Ruby on Rails
Rails Girls: Programming, Web Applications and Ruby on Rails
 
Landskap Kejur Siarkaki
Landskap Kejur SiarkakiLandskap Kejur Siarkaki
Landskap Kejur Siarkaki
 
Mutation testing with the mutant gem
Mutation testing with the mutant gemMutation testing with the mutant gem
Mutation testing with the mutant gem
 
LA 02 Pokok dan Palma
LA 02 Pokok dan PalmaLA 02 Pokok dan Palma
LA 02 Pokok dan Palma
 
LA 02 Penyediaan Tanah Nurseri Lanskap
LA 02   Penyediaan Tanah Nurseri LanskapLA 02   Penyediaan Tanah Nurseri Lanskap
LA 02 Penyediaan Tanah Nurseri Lanskap
 
Landskap Kejur Pengenalan
Landskap Kejur PengenalanLandskap Kejur Pengenalan
Landskap Kejur Pengenalan
 
The Good Doctor by Neil Simon Power Point
The Good Doctor by Neil Simon Power PointThe Good Doctor by Neil Simon Power Point
The Good Doctor by Neil Simon Power Point
 

Similar to Rails - How does it work?

Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.
Daniel Downs
 
HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010
alanburke
 
Doctype html
Doctype htmlDoctype html
Doctype html
Eddy_TKJ
 

Similar to Rails - How does it work? (20)

HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.
 
Single Page Web App
Single Page Web AppSingle Page Web App
Single Page Web App
 
iWebkit
iWebkitiWebkit
iWebkit
 
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
 
Stole16
Stole16Stole16
Stole16
 
JQuery Mobile UI
JQuery Mobile UIJQuery Mobile UI
JQuery Mobile UI
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
RDFa in ostala spletna semantika
RDFa in ostala spletna semantikaRDFa in ostala spletna semantika
RDFa in ostala spletna semantika
 
jQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisjQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveis
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for Programmers
 
HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010
 
Microformats: what are they and why do I care?
Microformats: what are they and why do I care?Microformats: what are they and why do I care?
Microformats: what are they and why do I care?
 
Take Your Markup to 11
Take Your Markup to 11Take Your Markup to 11
Take Your Markup to 11
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
Doctype html
Doctype htmlDoctype html
Doctype html
 
Mobile Dev Trends and Confluence Mobile, AtlasCamp US 2012
Mobile Dev Trends and Confluence Mobile, AtlasCamp US 2012Mobile Dev Trends and Confluence Mobile, AtlasCamp US 2012
Mobile Dev Trends and Confluence Mobile, AtlasCamp US 2012
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupal
 

Recently uploaded

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Rails - How does it work?

  • 1. A RAILS APP How does it work? @donschado @klaustopher Donnerstag, 21. November 13
  • 4. URL localhost:3000/ Request GET / Response <html lang="en"> <head> <title>Facebook Lite</title> <link href="/assets/application.css" media="all" rel="stylesheet"> <script src="/assets/application.js"></script> </head> <body> <div> <h1>Das Neuste aus dem ganzen Netzwerk</h1> <ul> <li> <img src="https://somewhere.github.com/1062e0f.png"> <div class="media-body"> <h4>Liane<small>19 Nov 20:32</small></h4> <p>Ich bin hier!!!</p> </div> </li> <li> <img src="https://somwhere.github.com/fa47a113f69.png"> <div> <h4>Marco<small>19 Nov 20:02</small></h4> <p>Hallo, ist da wer?</p> </div> </li> <li> <img src="https://somwhere.github.com/fa47a113f69.png"> <div> <h4>Marco<small>19 Nov 19:02</small></h4> <p>Hallo Welt!</p> </div> </li> </ul> </div> </body> </html> Router routes.rb Controller    <head>          <title>Facebook  Lite</title>          <%=  javascript_include_tag  "application"  %>    </head> Partial        </div>    </body> </html> Donnerstag, 21. November 13 Layout application.html.erb post.rb _post.html.erb class Post < ActiveRecord::Base end ...  </h1>          <%=  stylesheet_link_tag        "application",  media:  "all"  %>            <%=  yield  %> Model index.html.erb <ul>    <%=  render  @posts  %> </ul> <html  lang="en">        <div  class="container"> get ’/’ => ‘welcome#index’ welcome_controller.rb <h1>Das neuste aus    <body> same as class WelcomeController < ApplicationController def index @posts = Post.... end end View Render HTML root ”welcome#index“ <li>    <%=  image_tag(post.user.avatar)  %>    <%=  post.user.name  %>    <%=  post.content  %> </li> Datenbank db/schema.rb create_table  t.text   t.integer   t.datetime   t.datetime end "posts" do |t| "content" "user_id" "created_at" "updated_at"