Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails 2.3, 3.0 and 3.1 - RubyConf US 2011

Rails 2.3, 3.0 and 3.1 - RubyConf US 2011

Plataformatec

March 08, 2012
Tweet

More Decks by Plataformatec

Other Decks in Technology

Transcript

  1. #1 thin start } #2 (inside thin) require “rack” From

    command line } Rubygems loads latest version: 1.1.0 #3 (inside rails) gem “rack”, “~> 1.0.0”
  2. Controll er View Render 2.2 View paths Find template Rendere

    d templat e Templa te Template Template
  3. Controll er View Render + 3.0 View paths Find template

    Rendere d templat e Templa te Template Template Lookup Resolv er Template Find template
  4. The view only parses options Lookup context stores details Resolvers

    find templates View paths hold resolvers Handlers render templates
  5. Rails::Railtie class ActiveRecord::Railtie < Rails::Railtie config.generators.orm :active_record, :migration => true,

    :timestamps => true rake_tasks do load "active_record/railties/databases.rake" end initializer "active_record.initialize_timezone" do ActiveRecord.time_zone_aware_attributes = true ActiveRecord.default_timezone = :utc end end
  6. #2 Create controller and action class JavascriptsController < ApplicationController self.view_paths

    = ["app/javascripts"] def index render :template => params[:path] end end
  7. Controll er View Render + View paths Find template Rendere

    d templat e Templa te Template Template Lookup Resolv er Template Find template
  8. Rack::Cac Internet App /posts/1 /posts/1 Cache-Control: public Last-Modified: 13, Oct

    10 <html>... Cache-Control: public Last-Modified: 13, Oct 10 <html>... /posts/1 If-Modified-Since: 13, Oct 10 /posts/1 304 Not Modified Cache-Control: public Last-Modified: 13, Oct 10 <html>...