SlideShare a Scribd company logo
1 of 21
Download to read offline
Rails vs Node.js
2015.09.17
Sky
FB: jcsky.wang
Ruby on Rails: 6 months
Node.js: 1 week / 1 project
jcskyting@gmail.com
WHY~?!
• Ruby on Rails: AlphaCamp ihower
• Node.js: front-end interview (javascript, full-stack)
Rails vs Node.js
Ruby
Rails
Rails server engine /
event driven gem
include many many
CRUD / DataBase / safe
sync
javascript
express / koa / sails ..
node.js

npm any you want
speed / realtime / anyway
you want
async
Rails vs Node.js
Node.js is not framework..
express / koa / hapi / sails
Rails vs Node.js
• javascript Debug (chrome console )
Rails vs Node.js
• Node.js server log Debug
Rails error
Rails vs Node.js
• Rails console debug
Rails vs Node.js
• Rails method database code
• : DB
• : DataBase
Event.joins(:category)
# SELECT "events".* FROM "events" INNER JOIN "categories" ON "categories"."id" =
"events"."category_id"
Event.includes(:category, :attendees)
# SELECT "events".* FROM "events"
# SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1,2,3...)
# SELECT "attendees".* FROM "attendees" WHERE "attendees"."event_id" IN (4, 5, 6,
7, 8...)
Rails vs Node.js
• not only Ruby, numerous Rails helper method
html
<%= render :partial => 'form', :locals => { :f => f } %>
form
<%= form_for @event, :url => { :controller => 'events', :action =>
'update', :id => @event } do |f| %>
<%= f.textarea :description, :class=>”w100p”, :rows =>10 %>
<%= f.submit "Update" %>
<% end %>
controller method
before_action :set_event, :only => [ :show, :edit, :update, :destroy]
session read/write
session[:hahaha]
Rails vs Node.js
• Rails have some Security Design ( )
CSRF(Cross-site request forgery)
Rails CSRF POST
HTML:
<input type="hidden" name="authenticity_token" value="zFGT
+TiykMj7Tsip3sY5G7iELupGD3BttZ8x6F2diThGOVH9+nEoXxkeLOhuLx9kGaWRoOh
ZuwY+OXzXU3EevA==">
Parameters:
{"utf8"=>"✓", "authenticity_token"=>"HC4eVH/
wdojRqSJFk8xYdobZPByVTFkh2WiCbK6HYb+WRtxQvTPOHzP5xgQjJX4JJ/
iDVjsakkpSzs9ToGv2Ow==", "issue"=>{"title"=>"yaya", "description"=>"what the
fuck"}, "commit"=>" "}
Rails vs Node.js
• Rails have some Security Design( )
XSS(Cross-Site Scripting)
Script
<script>
&lt;script&gt; Rails
HTML
Rails vs Node.js
• Rails have some Security Design( )
log ( )
Processing UsersController#create (for 127.0.0.1 at 2009-01-02 11:02:33) [POST]
Parameters: {"user"=>{"name"=>"susan",
"password_confirmation"=>"[FILTERED]", "password"=>"[FILTERED]"},
"commit"=>"Register", "action"=>"create",
"authenticity_token"=>"9efc03bcc37191d8a6dc3676e2e7890ecdfda0b5",
"controller"=>"users"}
Ruby vs javascript
gem vs npm
• ~?!! npm.count !!
Rails intro
MVC
Model-View-Control
route.rb
HTTP request
GET /users/1
Browser
UsersController
end
def show
@user = User.find(params[:id])
respond_to do |format|
format.html
format.xml
end
end
def index
......
end
Model
Database
#show.html.erb
<html>
<h1>User Profile</h1>
<p><%= @user.nickname %></p>
</html>
View
Controller Action
Rails intro
Rails ?
• Justin Gehtland Java :Rails = 3.5 : 1
• Proc.net PHP : Rails = 10 : 1
• JavaEye JAVA : Rails = 10 : 1
• thegiive PHP : Rails = 8 : 1
Rails vs Node.js
Ruby
Rails
Rails server engine /
event driven gem
include many many
CRUD / DataBase / safe
javascript
express / koa / sails ..
node.js

npm any you want
speed / realtime /
anyway you want
in the future
Real Time App / Web
theword.tw
FB: www.facebook.com/theword.tw
vs
(
..)
…(
)
~!!

More Related Content

What's hot

Ruby on Rails - UNISO
Ruby on Rails - UNISORuby on Rails - UNISO
Ruby on Rails - UNISOLucas Renan
 
Scala.js: Next generation front end development in Scala
Scala.js:  Next generation front end development in ScalaScala.js:  Next generation front end development in Scala
Scala.js: Next generation front end development in ScalaOtto Chrons
 
Intro to Scala.js - Scala UG Cologne
Intro to Scala.js - Scala UG CologneIntro to Scala.js - Scala UG Cologne
Intro to Scala.js - Scala UG CologneMarius Soutier
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by defaultYi-Ting Cheng
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web ComponentsColdFusionConference
 
Using a simple Ruby program to interface with quickly provisioned cloud appli...
Using a simple Ruby program to interface with quickly provisioned cloud appli...Using a simple Ruby program to interface with quickly provisioned cloud appli...
Using a simple Ruby program to interface with quickly provisioned cloud appli...Cloud Elements
 
REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentHyunghun Cho
 
AWS Lambda with ClaudiaJS
AWS Lambda with ClaudiaJSAWS Lambda with ClaudiaJS
AWS Lambda with ClaudiaJSRiza Fahmi
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline WebBruno Oliveira
 
Optimizing Your Site
Optimizing Your SiteOptimizing Your Site
Optimizing Your Sitertvenge
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsRoman Kalyakin
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsJohn Anderson
 
Kraken Front-Trends
Kraken Front-TrendsKraken Front-Trends
Kraken Front-TrendsPayPal
 
WordCamp 5.3 & Community
WordCamp 5.3 & CommunityWordCamp 5.3 & Community
WordCamp 5.3 & CommunityYuriko IKEDA
 

What's hot (20)

Ruby on Rails - UNISO
Ruby on Rails - UNISORuby on Rails - UNISO
Ruby on Rails - UNISO
 
Scala.js: Next generation front end development in Scala
Scala.js:  Next generation front end development in ScalaScala.js:  Next generation front end development in Scala
Scala.js: Next generation front end development in Scala
 
Webdriver
WebdriverWebdriver
Webdriver
 
Intro to Scala.js - Scala UG Cologne
Intro to Scala.js - Scala UG CologneIntro to Scala.js - Scala UG Cologne
Intro to Scala.js - Scala UG Cologne
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by default
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
 
Using a simple Ruby program to interface with quickly provisioned cloud appli...
Using a simple Ruby program to interface with quickly provisioned cloud appli...Using a simple Ruby program to interface with quickly provisioned cloud appli...
Using a simple Ruby program to interface with quickly provisioned cloud appli...
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side Development
 
Intro to sbt-web
Intro to sbt-webIntro to sbt-web
Intro to sbt-web
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
AWS Lambda with ClaudiaJS
AWS Lambda with ClaudiaJSAWS Lambda with ClaudiaJS
AWS Lambda with ClaudiaJS
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline Web
 
Optimizing Your Site
Optimizing Your SiteOptimizing Your Site
Optimizing Your Site
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web apps
 
Kraken Front-Trends
Kraken Front-TrendsKraken Front-Trends
Kraken Front-Trends
 
Getting started with node.js
Getting started with node.jsGetting started with node.js
Getting started with node.js
 
Rails with mongodb
Rails with mongodbRails with mongodb
Rails with mongodb
 
WordCamp 5.3 & Community
WordCamp 5.3 & CommunityWordCamp 5.3 & Community
WordCamp 5.3 & Community
 

Viewers also liked

Top 5 engineer cover letter samples
Top 5 engineer cover letter samplesTop 5 engineer cover letter samples
Top 5 engineer cover letter samplesferidonri
 
Aktiivinen oppiminen - Oppimistehtävät verkossa
Aktiivinen oppiminen - Oppimistehtävät verkossaAktiivinen oppiminen - Oppimistehtävät verkossa
Aktiivinen oppiminen - Oppimistehtävät verkossaSatu Aksovaara
 
Как определить овуляцию?
Как определить овуляцию?Как определить овуляцию?
Как определить овуляцию?Moyaberemennost.ru
 
Теория истории 2
Теория истории 2Теория истории 2
Теория истории 2Unification_Ru
 
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"Asociación El Mundo de los ASI
 
Ekokoulu tilannekatsaus 2016-10-18
Ekokoulu tilannekatsaus 2016-10-18Ekokoulu tilannekatsaus 2016-10-18
Ekokoulu tilannekatsaus 2016-10-18Johanna Janhonen
 
Perkhidmatan terapi estetik
Perkhidmatan terapi estetikPerkhidmatan terapi estetik
Perkhidmatan terapi estetikbell ahmad
 
Aula completa reino monera
Aula completa reino moneraAula completa reino monera
Aula completa reino moneraNELSON COSTA
 

Viewers also liked (11)

Top 5 engineer cover letter samples
Top 5 engineer cover letter samplesTop 5 engineer cover letter samples
Top 5 engineer cover letter samples
 
Aktiivinen oppiminen - Oppimistehtävät verkossa
Aktiivinen oppiminen - Oppimistehtävät verkossaAktiivinen oppiminen - Oppimistehtävät verkossa
Aktiivinen oppiminen - Oppimistehtävät verkossa
 
La gestión de crisis en entornos digitales
La gestión de crisis en entornos digitales La gestión de crisis en entornos digitales
La gestión de crisis en entornos digitales
 
Как определить овуляцию?
Как определить овуляцию?Как определить овуляцию?
Как определить овуляцию?
 
Теория истории 2
Теория истории 2Теория истории 2
Теория истории 2
 
For Print
For PrintFor Print
For Print
 
Rodrigo Co (CV)
Rodrigo Co (CV)Rodrigo Co (CV)
Rodrigo Co (CV)
 
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"
Conferencia de Carlos Rozanski: "Denunciar o silenciar el abuso sexual infantil"
 
Ekokoulu tilannekatsaus 2016-10-18
Ekokoulu tilannekatsaus 2016-10-18Ekokoulu tilannekatsaus 2016-10-18
Ekokoulu tilannekatsaus 2016-10-18
 
Perkhidmatan terapi estetik
Perkhidmatan terapi estetikPerkhidmatan terapi estetik
Perkhidmatan terapi estetik
 
Aula completa reino monera
Aula completa reino moneraAula completa reino monera
Aula completa reino monera
 

Similar to RoR vs-nodejs-by-jcskyting

RoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskytingRoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskyting信凱 王
 
RoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskytingRoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskyting信凱 王
 
Web Performance Workshop - Velocity London 2013
Web Performance Workshop - Velocity London 2013Web Performance Workshop - Velocity London 2013
Web Performance Workshop - Velocity London 2013Andy Davies
 
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代Shengyou Fan
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationAndrew Rota
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbonezonathen
 
AWS meets Continuous Delivery
AWS meets Continuous DeliveryAWS meets Continuous Delivery
AWS meets Continuous DeliveryAndreas Mohrhard
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.Mike Brevoort
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Vendic Magento, PWA & Marketing
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.jsRody Middelkoop
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Jamie Matthews
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 

Similar to RoR vs-nodejs-by-jcskyting (20)

RoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskytingRoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskyting
 
RoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskytingRoR vs-nodejs-by-jcskyting
RoR vs-nodejs-by-jcskyting
 
Web Performance Workshop - Velocity London 2013
Web Performance Workshop - Velocity London 2013Web Performance Workshop - Velocity London 2013
Web Performance Workshop - Velocity London 2013
 
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
HTML 5 & CSS 3
HTML 5 & CSS 3HTML 5 & CSS 3
HTML 5 & CSS 3
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
AWS meets Continuous Delivery
AWS meets Continuous DeliveryAWS meets Continuous Delivery
AWS meets Continuous Delivery
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
huhu
huhuhuhu
huhu
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
08 ajax
08 ajax08 ajax
08 ajax
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 

Recently uploaded

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 

RoR vs-nodejs-by-jcskyting

  • 2. Sky FB: jcsky.wang Ruby on Rails: 6 months Node.js: 1 week / 1 project jcskyting@gmail.com
  • 3. WHY~?! • Ruby on Rails: AlphaCamp ihower • Node.js: front-end interview (javascript, full-stack)
  • 4. Rails vs Node.js Ruby Rails Rails server engine / event driven gem include many many CRUD / DataBase / safe sync javascript express / koa / sails .. node.js
 npm any you want speed / realtime / anyway you want async
  • 5. Rails vs Node.js Node.js is not framework.. express / koa / hapi / sails
  • 6. Rails vs Node.js • javascript Debug (chrome console )
  • 7. Rails vs Node.js • Node.js server log Debug
  • 9. Rails vs Node.js • Rails console debug
  • 10. Rails vs Node.js • Rails method database code • : DB • : DataBase Event.joins(:category) # SELECT "events".* FROM "events" INNER JOIN "categories" ON "categories"."id" = "events"."category_id" Event.includes(:category, :attendees) # SELECT "events".* FROM "events" # SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1,2,3...) # SELECT "attendees".* FROM "attendees" WHERE "attendees"."event_id" IN (4, 5, 6, 7, 8...)
  • 11. Rails vs Node.js • not only Ruby, numerous Rails helper method html <%= render :partial => 'form', :locals => { :f => f } %> form <%= form_for @event, :url => { :controller => 'events', :action => 'update', :id => @event } do |f| %> <%= f.textarea :description, :class=>”w100p”, :rows =>10 %> <%= f.submit "Update" %> <% end %> controller method before_action :set_event, :only => [ :show, :edit, :update, :destroy] session read/write session[:hahaha]
  • 12. Rails vs Node.js • Rails have some Security Design ( ) CSRF(Cross-site request forgery) Rails CSRF POST HTML: <input type="hidden" name="authenticity_token" value="zFGT +TiykMj7Tsip3sY5G7iELupGD3BttZ8x6F2diThGOVH9+nEoXxkeLOhuLx9kGaWRoOh ZuwY+OXzXU3EevA=="> Parameters: {"utf8"=>"✓", "authenticity_token"=>"HC4eVH/ wdojRqSJFk8xYdobZPByVTFkh2WiCbK6HYb+WRtxQvTPOHzP5xgQjJX4JJ/ iDVjsakkpSzs9ToGv2Ow==", "issue"=>{"title"=>"yaya", "description"=>"what the fuck"}, "commit"=>" "}
  • 13. Rails vs Node.js • Rails have some Security Design( ) XSS(Cross-Site Scripting) Script <script> &lt;script&gt; Rails HTML
  • 14. Rails vs Node.js • Rails have some Security Design( ) log ( ) Processing UsersController#create (for 127.0.0.1 at 2009-01-02 11:02:33) [POST] Parameters: {"user"=>{"name"=>"susan", "password_confirmation"=>"[FILTERED]", "password"=>"[FILTERED]"}, "commit"=>"Register", "action"=>"create", "authenticity_token"=>"9efc03bcc37191d8a6dc3676e2e7890ecdfda0b5", "controller"=>"users"}
  • 16. gem vs npm • ~?!! npm.count !!
  • 17. Rails intro MVC Model-View-Control route.rb HTTP request GET /users/1 Browser UsersController end def show @user = User.find(params[:id]) respond_to do |format| format.html format.xml end end def index ...... end Model Database #show.html.erb <html> <h1>User Profile</h1> <p><%= @user.nickname %></p> </html> View Controller Action
  • 18. Rails intro Rails ? • Justin Gehtland Java :Rails = 3.5 : 1 • Proc.net PHP : Rails = 10 : 1 • JavaEye JAVA : Rails = 10 : 1 • thegiive PHP : Rails = 8 : 1
  • 19. Rails vs Node.js Ruby Rails Rails server engine / event driven gem include many many CRUD / DataBase / safe javascript express / koa / sails .. node.js
 npm any you want speed / realtime / anyway you want
  • 20. in the future Real Time App / Web