• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Rubyon Rails
 

Rubyon Rails

on

  • 584 views

 

Statistics

Views

Total Views
584
Views on SlideShare
576
Embed Views
8

Actions

Likes
0
Downloads
2
Comments
0

2 Embeds 8

http://www.linkedin.com 5
http://www.apurva.com 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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

    Rubyon Rails Rubyon Rails Presentation Transcript

    • Ruby on Rails The most awesome thing to hit the internet since Rick Astley UW – Eau Claire Web-Centric Programming May 30, 2009 Presenter: Kevin Gisi [email_address] Twitter: gisikw
    • About the Presenter
      • Computer Engineering
      • LTS – Web Development
      • Independent Contractor
      • Co-founder of the Eau Claire Ruby User Group
      • Winner of the RailsRumble “Most Innovative” award
      • Pragmatic Programmers Author
    • What is Ruby?
      • Developed in the 1990’s in Japan
      • C-based interpreted language
      • Dynamically (“duck”) typed
      • Based on Perl and Smalltalk
      • Many different implementations (YARV, JRuby, Rubinius, IronRuby, MacRuby)
      • Completely open-source
    • What is Rails?
      • Web application framework
      • Extracted from 37Signals in 2004
      • Model – View – Controller
      • Convention over Configuration
      • Don’t Repeat Yourself (DRY)
      • Representational State Transfer (REST)
      • Completely open-source
    • Convention: REST
      • Everything is a resource
      • You Create (POST), Read (GET), Update (PUT), and Destroy (DELETE) resources
      • Also need New, and Edit pages
    • Convention: URLs
      • URLs should be pretty!
      • Index /listings
      • New /listings/new
      • Show /listings/5
      • Edit /listings/5/edit
      • Create /listings
      • Update /listings/5
      • Destroy /listings/5
    • Ruby on Rails Tools
      • RubyGems – Package Manager
      • Plugins – Adds functionality
      • Generators – Writes code for you
      • Console – Access runtime environment
    • Server Structure Front-end Apache/Nginx Server – 5000 Mongrel Server – 5001 Mongrel Server – 5002 Mongrel Database
    • What Runs On Rails?
      • Hulu
      • Twitter
      • 37 Signals
      • Blinksale
      • Many UWEC Applications
    • 2-Minute Ruby
      • Everything is an object
      • Anything other than false or nil is “true”
      • Functions always return something
      • Classes can be modified at runtime
      • @instance_variables
      • @@class_variables
      • CONSTANTS
    • 2-Minute Ruby
      • Arrays [ ]
      • Ordered, dynamically sized
      • my_array << value
      • my_array[4]
      • my_array.pop
    • 2-Minute Ruby
      • Hashes { }
      • Not ordered
      • Key, value pairs
      • Keys are traditionally :symbols
      • Awesome for methods
    • 2-Minute Ruby Methods def foo(params = {}) “ You said” + params[:message] end
    • 2-Minute Ruby
      • Methods (continued)
      • mutate!, boolean?, assignment=
      • def method_missing
      • “ We don’t do that!”
      • end
    • 2-Minute Ruby Classes class Awesome attr_accessor :pie end a = Awesome.new a.pie
    • 2-Minute Ruby Blocks my_array.each do |value| puts “It was #{value}” end
    • 2-Minute Ruby Pretend I Didn’t Show You This eval(“foo = 5”)
    • 3-Minute Rails
      • Models
      • Validations
      • Business logic
      • Other object methods
      • Anything that doesn’t go somewhere else
    • 3-Minute Rails
      • Controllers
      • Before filters
      • Public actions
      • Keep them small!
    • 3-Minute Rails
      • Views
      • Display
      • Mix of HTML and ERb (Embedded Ruby)
      • Avoid logic here!
    • 3-Minute Rails
      • Helpers
      • Custom embedded Ruby:
      • def paypal
      • “ <form>Paypal donate code</form>”
      • end
    • Boo Slides! Let’s be awesome code monkeys instead!