Ruby On Rails Overview
Upcoming SlideShare
Loading in...5
×
 

Ruby On Rails Overview

on

  • 4,156 views

This is a slide deck that I modified to give some great intro information for people to both Ruby and Ruby on Rails

This is a slide deck that I modified to give some great intro information for people to both Ruby and Ruby on Rails

Statistics

Views

Total Views
4,156
Views on SlideShare
4,152
Embed Views
4

Actions

Likes
1
Downloads
52
Comments
0

1 Embed 4

http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • http://www.flickr.com/photos/foreversouls/2357763471/sizes/l/
  • def is_friday? <br /> today = Date.today <br /> friday = today.end_of_week - 2.days <br /> today == friday <br /> end <br /> <br /> today = Date.today <br /> <br /> puts "I&apos;m in a good mood&#x201D; if today.is_friday? <br /> <br /> puts "I&apos;m in a bad mood" unless today.is_friday? <br /> <br /> today.is_friday? ? "great mood" : "bad mood"
  • Public and private methods don&#x2019;t &#x201C;really&#x201D; exist&#x2026; you can use send to call them. Private and protected are really just ideas&#x2026; I intend for you not to call this because I may change this and you should not rely on it
  • Rails isn&#x2019;t academic software. Every feature is extracted from a plugin or a working project from 37signals
  • http://www.flickr.com/photos/dotdoubledot/1979443914/sizes/l/
  • http://www.flickr.com/photos/redjar/113152393/

Ruby On Rails Overview Ruby On Rails Overview Presentation Transcript

  • Ruby on Rails Overview Jon Kinney Avastone Technologies
  • What is it?
  • Ruby the Programming Language Rails the Web Framework
  • Language Framework Ruby Rails C# WebForms C# ASP.NET MVC PHP Zend Java Struts Java Spring MVC
  • What’s the big deal?
  • Fun! Easy! Productive!
  • Why should I care?
  • Broaden your Horizons
  • Learn from other frameworks and languages Be a better
  • What is Ruby?
  • Object Oriented Java Ruby Python VB.NET C++ C#
  • Dynamically Typed Not compiled Code is executed at run time
  • The Ruby Language
  • The .each Method
  • Everything’s an objec
  • Defining methods Everything in ruby is true except nil and false Ruby automatically returns the last statement in a method
  • The “unless” statement
  • “if” at the end “else” at the end
  • Garbage Object Collection Oriented Good Public and IDE’s Private Methods Similar to C#
  • No curly No braces or Compile- semicolon time s checking Dynamic Interpreted Typing Different from C#
  • What is Rails?
  • Ruby on Rails is an open-source web framework that's optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration
  • Model View Controller Framework
  • Model req ues t Controller res po n se View
  • All in one! ASP.NET Ruby on Rails MVC Presentation ASP.NET Rails MVC Database migrations T-SQL Rails Data access & LINQ to Rails persistence Entities Unit testing NUnit Rails Testing web pages (?) Rails Testing cookies and (?) Rails session state
  • Opinionated Software Not Academic Convention over Configuration
  • Conventions • Singular camel cased model/class names • Plural lower case and underscored • Db table names • Variable names • Method names • Primary key called “id” • Db fields called created_at and updated_at • Get free timestamps when performing
  • D.R.Y. Don’t Repeat Yourself Each piece of knowledge should have one and only one place to live
  • An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data. ~ Martin Fowler Active Record
  • Running Rails
  • Runs on ….
  • Store stuff in … And others …
  • Write code with ….
  • Walkthrough Creating a Rails Project in 3 Steps
  • Step 1
  • They ALL look like
  • Step 2 (optional) # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000
  • Step 3 – Boot Mongrel Or use the Passenger Preference Pane for Apache2
  • Tada!!
  • DEMO Cookbook