SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
Ruby-on-Rails

&
PostgreSQL
John Ashmead
Ruby-on-Rails
•

Based on Ruby

•

A Framework, like Django

•

Widely popular

•

Ruby + ActiveRecord + Lots of Web Stuff + Lots of
other Stuff

•

Michael Hardt: http://ruby.railstutorial.org
Ruby Version
Manager
•

RVM lets you run multiple versions of ruby

•

Copies everything into some trees, then switches
pointers around

•

Manages gems & gemsets

•

Bundle install, bundle update
Gemfile
source 'https://rubygems.org'
!

ruby '2.0.0'
!

# Make sure we are using latest ‘rails’
gem 'rails', '4.0.0'
!

# Use Postgres as the database for Active Record
gem 'pg'
!

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
!

# switch to bootstrap, rspec, factory_girl, selenium,
capybara
!

…
ActiveRecord
•

Database adaptor

id

•

General purpose

name

•

Convention over
configuration

•

Reasonable defaults

•

Standalone product

maps

description
created_at
updated_at
Finally, PostgreSQL
•

‘pg’ gem

•

Provides ActiveRecord with
interface to Postgres

•

AR has an “execute”
function that lets you run
raw sql

•

‘postgres-pr’ gem gives
access to PostgreSQL
specific features, if needed
Foreign Keys
•

ActiveRecord has a lot of “associations”

•

Has_many, belongs_to, has_and_belongs_to_many

•

Doesn’t clean up the existing database

•

Doesn’t automatically generate the relevant keys

•

Doesn’t fix the metadata
create_table "maps", force: true do |t|
t.integer "user_id"
t.string
"map_type",
t.string
"name"
t.text
"description"
t.decimal "map_width"
t.decimal "map_height"
t.datetime "created_at"
t.datetime "updated_at"
end
CREATE TABLE maps (
id integer NOT NULL,
user_id integer,
map_type character varying(255),
name character varying(255),
description text,
map_width numeric,
map_height numeric,
created_at timestamp without time zone,
updated_at timestamp without time zone
);

Weirder
than
it
looks
Migrations
rails generate scaffold Map user_id:integer map_type:string
name:string description:text map_width:decimal
map_height:decimal

class CreateMaps < ActiveRecor
def change
create_table :maps do |t|
t.integer :user_id
t.string :map_type,
t.string :name,
t.text :description
t.decimal :map_width
t.decimal :map_height
!

t.timestamps
end
end
end
rake db:migrate && rails db:migrate RAILS_ENV=test
Heroku stack
•

Ruby-on-Rails front end

•

PostgreSQL preferred

•

Well documented

•

Free up to a reasonable point

•

Integrated with github

•

Lots of tools

•

Mostly works

•

https://www.heroku.com
Red

Green

Refactor

•

Agile & Stories

•

Examples & TDD (Testdriven development) over
APIs

•

MVC: Model/View/
Controller

•

Upgrades in RoR much
trickier than in PostgreSQL
Domain Specific Languages
•

•

PostgreSQL makes it
easy to hook existing
languages in: i.e.
Javascript as a server
language.

•

Gems versus packages.
About 30K gems! Of
widely varying quality.

•

YMMV

describe "home page" do

let!(:person) 
{ FactoryGirl.create(:person) }

}

Ruby makes it easy to
write DSLs

before {
sign_in person
visit home_people_path(person)
}
it { should have_content(person.name)
it { should have_title(person.name) }
end
Long learning curves
•

Ruby-on-rails has a
lot of levels

•

Achieving rapport
with rails takes time

•

Help: railscasts,
stackoverflow, …

•

Grow little neurons,
grow (damn you!)
There’s a page for that
•

http://localhost:8081/phpPgAdmin/

•

http://guides.rubyonrails.org

•

http://api.rubyonrails.org

•

https://codeclimate.com

•

http://localhost:3000

•

https://github.com

•

http://ruby.railstutorial.org/book/ruby-on-rails-tutorial?
version=4.0

•

http://ruby-doc.com/docs/ProgrammingRuby/

•

…

Más contenido relacionado

La actualidad más candente

Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
Tim Lossen
 
using-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offlineusing-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offline
Andrej Babolcai
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloud
elliando dias
 

La actualidad más candente (20)

Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
 
using-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offlineusing-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offline
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
 
Adding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of TricksAdding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of Tricks
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
 
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSpherevBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloud
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Intro to Clojure lightningtalk
Intro to Clojure lightningtalkIntro to Clojure lightningtalk
Intro to Clojure lightningtalk
 
Terraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesTerraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud Services
 
IDLs
IDLsIDLs
IDLs
 
Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and Python
 
Altitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TEDAltitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TED
 
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity StonesACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
 
Aws opsworks for developers and designers
Aws opsworks for developers and designersAws opsworks for developers and designers
Aws opsworks for developers and designers
 
Terraform in action
Terraform in actionTerraform in action
Terraform in action
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 

Destacado

Destacado (7)

Not your Grandfather's Gravity
Not your Grandfather's GravityNot your Grandfather's Gravity
Not your Grandfather's Gravity
 
MAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHPMAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHP
 
Thought experiments
Thought experimentsThought experiments
Thought experiments
 
Time & Quantum Mechanics
Time & Quantum MechanicsTime & Quantum Mechanics
Time & Quantum Mechanics
 
invisibility: Theory and Practice - v1
invisibility:  Theory and Practice - v1invisibility:  Theory and Practice - v1
invisibility: Theory and Practice - v1
 
Star Gates: the Theory and Practice
Star Gates:  the Theory and PracticeStar Gates:  the Theory and Practice
Star Gates: the Theory and Practice
 
The Future of Time Travel
The Future of Time TravelThe Future of Time Travel
The Future of Time Travel
 

Similar a Ruby on Rails & PostgreSQL - v2

Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
Wen-Tien Chang
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Ricardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devopsRicardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devops
SVDevOps
 

Similar a Ruby on Rails & PostgreSQL - v2 (20)

Wider than rails
Wider than railsWider than rails
Wider than rails
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Workshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - SuestraWorkshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - Suestra
 
Rack
RackRack
Rack
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Ricardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devopsRicardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devops
 

Más de John Ashmead

From Startup to Mature Company: PostgreSQL Tips and techniques
From Startup to Mature Company:  PostgreSQL Tips and techniquesFrom Startup to Mature Company:  PostgreSQL Tips and techniques
From Startup to Mature Company: PostgreSQL Tips and techniques
John Ashmead
 

Más de John Ashmead (20)

The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
 
How to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quicklyHow to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quickly
 
The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
 
Artificial Intelligence: Past, Present, Futures
Artificial Intelligence:  Past, Present, FuturesArtificial Intelligence:  Past, Present, Futures
Artificial Intelligence: Past, Present, Futures
 
Time dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurementsTime dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurements
 
Time dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 versionTime dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 version
 
Time dispersion in quantum mechanics
Time dispersion in quantum mechanicsTime dispersion in quantum mechanics
Time dispersion in quantum mechanics
 
Mars Or Bust!
Mars Or Bust!Mars Or Bust!
Mars Or Bust!
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
 
From Startup to Mature Company: PostgreSQL Tips and techniques
From Startup to Mature Company:  PostgreSQL Tips and techniquesFrom Startup to Mature Company:  PostgreSQL Tips and techniques
From Startup to Mature Company: PostgreSQL Tips and techniques
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
 
Stargates: Theory and Practice
Stargates:  Theory and PracticeStargates:  Theory and Practice
Stargates: Theory and Practice
 
StarGates: Theory and Practice
StarGates:  Theory and PracticeStarGates:  Theory and Practice
StarGates: Theory and Practice
 
Quantum dots
Quantum dotsQuantum dots
Quantum dots
 
Time to the power of Tim
Time to the power of TimTime to the power of Tim
Time to the power of Tim
 
How many universes are there, anyway
How many universes are there, anywayHow many universes are there, anyway
How many universes are there, anyway
 
A Quantum of Mystery
A Quantum of MysteryA Quantum of Mystery
A Quantum of Mystery
 
Converting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLConverting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQL
 
Seven War Stories and a Moral
Seven War Stories and a MoralSeven War Stories and a Moral
Seven War Stories and a Moral
 
Automation
AutomationAutomation
Automation
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 

Ruby on Rails & PostgreSQL - v2

  • 2. Ruby-on-Rails • Based on Ruby • A Framework, like Django • Widely popular • Ruby + ActiveRecord + Lots of Web Stuff + Lots of other Stuff • Michael Hardt: http://ruby.railstutorial.org
  • 3. Ruby Version Manager • RVM lets you run multiple versions of ruby • Copies everything into some trees, then switches pointers around • Manages gems & gemsets • Bundle install, bundle update
  • 4. Gemfile source 'https://rubygems.org' ! ruby '2.0.0' ! # Make sure we are using latest ‘rails’ gem 'rails', '4.0.0' ! # Use Postgres as the database for Active Record gem 'pg' ! # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' ! # switch to bootstrap, rspec, factory_girl, selenium, capybara ! …
  • 5. ActiveRecord • Database adaptor id • General purpose name • Convention over configuration • Reasonable defaults • Standalone product maps description created_at updated_at
  • 6. Finally, PostgreSQL • ‘pg’ gem • Provides ActiveRecord with interface to Postgres • AR has an “execute” function that lets you run raw sql • ‘postgres-pr’ gem gives access to PostgreSQL specific features, if needed
  • 7. Foreign Keys • ActiveRecord has a lot of “associations” • Has_many, belongs_to, has_and_belongs_to_many • Doesn’t clean up the existing database • Doesn’t automatically generate the relevant keys • Doesn’t fix the metadata
  • 8. create_table "maps", force: true do |t| t.integer "user_id" t.string "map_type", t.string "name" t.text "description" t.decimal "map_width" t.decimal "map_height" t.datetime "created_at" t.datetime "updated_at" end CREATE TABLE maps ( id integer NOT NULL, user_id integer, map_type character varying(255), name character varying(255), description text, map_width numeric, map_height numeric, created_at timestamp without time zone, updated_at timestamp without time zone ); Weirder than it looks
  • 9. Migrations rails generate scaffold Map user_id:integer map_type:string name:string description:text map_width:decimal map_height:decimal class CreateMaps < ActiveRecor def change create_table :maps do |t| t.integer :user_id t.string :map_type, t.string :name, t.text :description t.decimal :map_width t.decimal :map_height ! t.timestamps end end end rake db:migrate && rails db:migrate RAILS_ENV=test
  • 10. Heroku stack • Ruby-on-Rails front end • PostgreSQL preferred • Well documented • Free up to a reasonable point • Integrated with github • Lots of tools • Mostly works • https://www.heroku.com
  • 11. Red Green Refactor • Agile & Stories • Examples & TDD (Testdriven development) over APIs • MVC: Model/View/ Controller • Upgrades in RoR much trickier than in PostgreSQL
  • 12. Domain Specific Languages • • PostgreSQL makes it easy to hook existing languages in: i.e. Javascript as a server language. • Gems versus packages. About 30K gems! Of widely varying quality. • YMMV describe "home page" do let!(:person) { FactoryGirl.create(:person) } } Ruby makes it easy to write DSLs before { sign_in person visit home_people_path(person) } it { should have_content(person.name) it { should have_title(person.name) } end
  • 13. Long learning curves • Ruby-on-rails has a lot of levels • Achieving rapport with rails takes time • Help: railscasts, stackoverflow, … • Grow little neurons, grow (damn you!)
  • 14. There’s a page for that • http://localhost:8081/phpPgAdmin/ • http://guides.rubyonrails.org • http://api.rubyonrails.org • https://codeclimate.com • http://localhost:3000 • https://github.com • http://ruby.railstutorial.org/book/ruby-on-rails-tutorial? version=4.0 • http://ruby-doc.com/docs/ProgrammingRuby/ • …