10
RUBY ON RAILS It’s so rad

RUBY ON RAILS It’s so rad. What we’ll cover What is Ruby? What is RoR? Why RoR? Developing with RoR Deployment Demo Questions

Embed Size (px)

Citation preview

Page 1: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

RUBY ON RAILS

It’s so rad

Page 2: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

What we’ll cover

What is Ruby? What is RoR? Why RoR? Developing with RoR Deployment Demo Questions

Page 3: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

What is Ruby?

Object-oriented language Written in 1995 by some smart Japanese

man Influenced by PERL, Python, and Lisp

(but mostly Python) EASY to understand, simple syntax

Page 4: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

What is RoR?

Full stack web application framework Written in Ruby (duh) Since 2004 Open Source Focused on rapid application

development

Page 5: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Why Ruby on Rails?

Rails is a framework Python – TurboGears, Django Java - JSP/Servlets, Struts PHP – Cake, Symfony

Convention over Configuration Super fast to get started writing useable code

class Project < ActiveRecord::Base

belongs_to :portfolio

has_one :project_manager

has_many :milestones

end

Page 6: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Developing with RoR

Rails gives the developer a solid infrastructure to build a

web application Model View Controller (MVC) Model, the Object Relational Mapper

Automatically maps the database to objects Very easy and natural to work with Thin layer with SQL – dynamically generates SQL queries

User.find_all User.find(:first, :conditions => [“user = ? AND password =?”],

user, pass) Controller, the logic of the application View, provides HTML templates and UI helpers

Page 7: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Developing with RoR

Page 8: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Developing with RoR

Support many database back-ends (db agnostic) Oracle, MySQL, PosgreSQL, SQLite

Built-in support for AJAX Built-in functional and unit testing Code tests while you develop Test templates are automatically generated Rails comes with a complete toolbox of

classes, helpers and utilities

Page 9: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Deployment

Rails apps are compatible with Unix and Windows environments Rails apps can be deployed on multiple web server Configurations

Mod_rails (Phusion Passenger) Mongrel/Mongrel Cluster (plus some Apache goodness for proxy) FastCGI – running behind Apache or Lighty CGI WEBrick – a standalone Ruby web server, easy for development

Easy control of the deployment with Capistrano A scripting tool to control the deployment of the application on

multiple sites Easy control of schema migration

rake migrate VERSION=3

Page 10: RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions

Demo

Real-time demo of the “Blog in 15 Minutes” (so it will probably take at least 20)