Rochester on Rails: Introduction to Rails

50 %
50 %
Information about Rochester on Rails: Introduction to Rails

Published on December 27, 2007

Author: jmorrison

Source: slideshare.net

Description

An entry-level introduction to Rails (circa 1.13) I gave at Rochester on Rails. Covers the history, reasons you may use it in a project, and basic architecture.

Jason Morrison January 19, 2006 Rochester on Rails Ruby on Rails Sustainable Productivity for Web Application Development

History

July 2004 David Heineimeier Hansson

Extracted from Basecamp

 

37signals

 

Hundreds of contributors Thousands of revisions, tickets, and patches

Rails 1.0 December 13, 2005

 

What is Rails?

Full Stack

Web Application Framework

It’s all Ruby!

(okay, except one file)

(here it is) database.yml development: adapter: sqlite dbfile: db/dev.db test: adapter: sqlite dbfile: db/test.db production: adapter: sqlite dbfile: db/prod.db

Everything else is Ruby!

ActiveRecord

ActionPack

ERb views

ActionWebService

ActionMailer

Unit Testing

AJAX Helpers

Key Concepts

DRY: Don’t Repeat Yourself

+

Convention over configuration

=

Less code!

Order.hbm.xml 01 <hibernate-mapping> 02 <class name=&quot;models.Order&quot; table=&quot;ORDERS&quot; 03 dynamic-update=&quot;true&quot; dynamic-insert=&quot;false&quot;> 06 <id name=&quot;id&quot; column=&quot;id&quot; type=&quot;java.lang.Long&quot; 07 unsaved-value=&quot;null&quot;> 08 <generator class=&quot;identity&quot;/> 09 </id> 10 <set name=&quot;items&quot; lazy=&quot;false&quot; inverse=&quot;false&quot; 11 cascade=&quot;none&quot; sort=&quot;unsorted&quot;> 12 <key column=&quot;id&quot;/> 13 <one-to-many class=&quot;models.Item&quot;/> 14 </set> 15 <property name=&quot;name&quot; type=&quot;java.lang.String&quot; 16 update=&quot;true&quot; insert=&quot;true&quot; 17 access=&quot;property&quot; column=&quot;name&quot;/> 18 </class> 19 </hibernate-mapping>

Order.java 01 public class Order { 02 private Set items; 03 private String name; 04 private Long id; 05 06 public Long getId() { return id;} 07 public void setId(Long id) { this.id = id;} 08 public Set getItems() { return items;} 09 public void setItems(Set items) { this.items = items; } 10 public String getName() { return name; } 11 public void setName(String name) { this.name = name; } 12 }

order.rb 01 class Order < ActiveRecord::Base 02 has_many :items 03 end

Rails is expressive

class Project < ActiveRecord::Base belongs_to :portfolio has_one :project_manager has_many :milestones has_and_belongs_to_many :categories validates_presence_of :name, :description validates_acceptance_of :non_disclosure_agreement validates_uniqueness_of :key end

#We’re slashing prices, all books are now half off! Product.find( :all, :conditions => “kind=‘book’” ) do |product| product.price *= 0.5 product.save end

Increases Programmer Rails increases programmer…

Increases Programmer Rails increases programmerhappiness!

How does it fit together?

Model View Controller

Model View Controller ActiveRecord ActionPack } }

 

Ready, set, code!

Add a comment

Related pages

Rochester, New York Ruby Programming Training Classes ...

Ruby Programming Training in Rochester, New York. Quality Instructors; Live Training; Small Classes; Excellent Student Reviews; ... » Ruby on Rails 4
Read more

N Rochester Model Rails - Welcome to the Oil Creek Rail ...

Rochester Model Rails ... Introduction: The Clinchfield Northern Railroad is based on the ... Rochester M odel Rails E MAGAZINE
Read more

Topics - RochesterSubway.com : Rochester 2020 — Rail vs ...

The introduction of light rail in this community is not ... You can SEE the rails! By ... a citizen’s group called the Rochester Rail Transit Committee ...
Read more

Introduction - Raymond Brown Rail - Home Page - Raymond ...

... without unplanned impacts on rail operations, ... Working from offices in Rochester ... Raymond Brown Rail gains five star rating for the ...
Read more

Introduction to Railroads

Introduction to Railroads ... railroad cars with steel wheels running along the steel rails of a railroad ... Railway Signaling. Rochester, New ...
Read more

rail - NYSDOT Home

... and north to Montreal, and modernize rail stations in Rochester and Buffalo. ... including introduction of higher speeds west of Albany. ...
Read more

Auburn and Rochester Railroad - Wikipedia, the free ...

Introduction. The Auburn and Rochester Railroad Company was built to bring Canandaigua access to regional and national markets and sources. Extending ...
Read more

ROCHESTER RAIL LLINK

ROCHESTER RAIL LLINK FEASIBILITY STUDY Prepared for Minnesota Department of Transportation Presented by Transportation Economics ... 8.1 Introduction ...
Read more

New York Central Railroad - Wikipedia, the free encyclopedia

The New York Central Railroad ... west of Rochester, ... the Gallet Watch Company for use by conductors and engineers of the New York Central Rail Road.
Read more