Intro to Rails and MVC

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Intro to Rails and MVC - Presentation Transcript

    1. An Introduction to Rails
    2. Ruby on Rails history
      Ruby on Rails was extracted from 37signals’ Basecamp by David Heinemeier Hansson (DHH)
      July 2004: first released as open source
      Feb 2005: first external commit rights
      Oct 2007: ships with Mac OS X v10.5 "Leopard”
    3. Rails Philosophy
      Opinionated
      Convention over configuration
      DRY (Don't Repeat Yourself)
      less code means it's easier to maintain & modify
      Test Driven Development (TDD)
      Minimal code - maximal effect
    4. Scaffold
      Model
      app/models/person.rb
      db/migrate/20090611073227_create_people.rb
      4 views
      app/views/people/index.html.erb
      app/views/people/show.html.erb
      app/views/people/new.html.erb
      app/views/people/edit.html.erb
      Controller
      app/controllers/people_controller.rb
      route map.resources :people
    5. MVC
    6. MVC
      Model: ActiveRecord
      Represents what is in the database
      View: ActionView, erb
      Model rendered as HTML
      Controller: ActionController
      Receives HTTP actions (GET, POST, PUT, DELETE)
      Decides what to do, typically rendering a view
    7. ActiveRecord
      p = new Person
      p = new Person(:first => "May", :last => "Fong")
      p.save
      p.save!
      Person.create(:first => "May", :last => "Fong")
      Person.create!(:first => "May", :last => "Fong")
    SlideShare Zeitgeist 2009

    + Sarah AllenSarah Allen Nominate

    custom

    216 views, 0 favs, 0 embeds more stats

    An introduction to Rails and its implementation of more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 216
      • 216 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 1
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags