Intro to Ruby and Rails




        Jon Homan
Agenda
●
    Ruby
       ●
           General Properties
       ●
           Syntax Examples
       ●
           Rules to ...
Ruby
General Properties
●
    Dynamic
●
    Interpreted
●
    Focus
       ●
           Simplicity
       ●
           Producti...
Consistent API
      Adapted from Brian Hogan's Intro to Ruby talk


●   ”Jon”.length
●   [”jon”, ”homan”, ”ruby”, ”rails”...
Syntax Examples




Interactive Ruby (irb)
Rules to Remember




Adapted from ”Intro to Ruby”
Rules to Remeber
1. Everything is an object
  25.class   #Fixnum
  ”jon”.class #String
Rules to Remember
2. Everything is true except nil or false
  n = 1
  puts n if n       #1


  n = nil
  puts n if n      ...
Rules to Remember
3. Variables are dynamically typed, but data is 
  strongly typed
  name = ”Jon”
  number = 42
  puts na...
Rules to Remember
4. Every method implicity returns the last statement
  def message
    if user
      ”Welcome!”
    else...
Rules to Remember
5. Classes are objects
  Wrong
      person = new Person


  Correct
      person = Person.new
Rails
Philosophy
●
    Convention over Configuration
●
    DRY
●
    REST
Overview
●
    MVC
●
    TATFT
●
    Developer Happiness and Productivity
●
    “Opinionated Software”
●
    Full stack
Out of the Box
●
    WEBrick – simple web server
●
    Rake – build system
●
    Scaffolding – CRUD operations
●
    Proto...
Event Registration
Resources
Brian Hogan's talk: http://tinyurl.com/introruby
Rails Guides: http://guides.rubyonrails.org/
C# vs. Ruby: http:...
Upcoming SlideShare
Loading in...5
×

Intro to Ruby on Rails

713

Published on

Introduction to Ruby on Rails talk that I gave a local .NET users group meeting.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
713
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Intro to Ruby on Rails

  1. 1. Intro to Ruby and Rails Jon Homan
  2. 2. Agenda ● Ruby ● General Properties ● Syntax Examples ● Rules to Remember ● Rails ● Philosophy ● Resources
  3. 3. Ruby
  4. 4. General Properties ● Dynamic ● Interpreted ● Focus ● Simplicity ● Productivity ● Developer Happiness ● Principle of Least Surprise
  5. 5. Consistent API Adapted from Brian Hogan's Intro to Ruby talk ● ”Jon”.length ● [”jon”, ”homan”, ”ruby”, ”rails”].length ● {'a' => 1, 'b' => 2}.length ● User.find_all().length
  6. 6. Syntax Examples Interactive Ruby (irb)
  7. 7. Rules to Remember Adapted from ”Intro to Ruby”
  8. 8. Rules to Remeber 1. Everything is an object 25.class #Fixnum ”jon”.class #String
  9. 9. Rules to Remember 2. Everything is true except nil or false n = 1 puts n if n  #1 n = nil puts n if n  #nil n = false puts n if n #nil
  10. 10. Rules to Remember 3. Variables are dynamically typed, but data is  strongly typed name = ”Jon” number = 42 puts name + number #TypeError: can't convert Fixnum into String puts name + number.to_s #Jon42
  11. 11. Rules to Remember 4. Every method implicity returns the last statement def message   if user     ”Welcome!”   else     ”You need to log in”   end end
  12. 12. Rules to Remember 5. Classes are objects Wrong     person = new Person Correct     person = Person.new
  13. 13. Rails
  14. 14. Philosophy ● Convention over Configuration ● DRY ● REST
  15. 15. Overview ● MVC ● TATFT ● Developer Happiness and Productivity ● “Opinionated Software” ● Full stack
  16. 16. Out of the Box ● WEBrick – simple web server ● Rake – build system ● Scaffolding – CRUD operations ● Prototype and Script.aculo.us ● Libraries through rubygems
  17. 17. Event Registration
  18. 18. Resources Brian Hogan's talk: http://tinyurl.com/introruby Rails Guides: http://guides.rubyonrails.org/ C# vs. Ruby: http://tinyurl.com/c­vsruby Railscasts: http://railscasts.com/ IronRuby: http://ironruby.net/ Ruby from X Lang: http://tinyurl.com/rubyfromx
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×