SlideShare a Scribd company logo
1 of 28
Download to read offline
•              Rails
        2.0   Preview Release
    •                           1.2.4

• 2.0
•
Behold, behold, Rails 2.0 is almost here. But before we
can slap on the final stamp, we’re going to pass through
a couple of trial release phases. The first is this preview
release, which allows you to sample the goodies in their
almost finished state.


•   2.0
•
•
•                          by DHH
We might change a few things or add something else, but by and large, this
is how Rails 2.0 is going to look and feel. After this release have had a
chance to be tried out, we’re going to move to a release candidate or two
(or three, depending on how many we need). Then, the final release.



•
                                  2.0
•


•
Before the release of 2.0, we’re also going to be putting
out 1.2.4, which will include a variety of bug fixes and
the last deprecation warnings to get you ready for
upgrading an existing application to 2.0 standards.

•   2.0                    1.2.4
    •
•
•                  2.0
                 deprecation warning
Enough about process. Let me tell you a little bit about
what’s new in Rails 2.0:




•   Rails 2.0
Action Pack: Resources



•
    •   namespace
    •   rake routes    routes

    •
Action Pack: Resources
  map.resources( :users, :has_many => :friends )

            config/routes
Action Pack: Multiview
                                     # should go in config/initializers/mime_types.rb
                                     Mime.register_alias quot;text/htmlquot;, :iphone

•   respond_to                       class ApplicationController < ActionController::Base
                                      before_filter :adjust_format_for_iphone

•                      show.rhtml     private

      show.html.erb                    def adjust_format_for_iphone
                                         if request.env[quot;HTTP_USER_AGENTquot;] &&
                                    request.env[quot;HTTP_USER_AGENTquot;][/(iPhone|iPod)/]

•                                          request.format = :iphone
    3.0   show.rhtml   deprecated        end
                                       end

•   show.csv.erb   text/csv   CSV    end

                                     class PostsController < ApplicationController
                                      def index
                                        respond_to do |format|

•                             −          format.html # renders index.html.erb
                                         format.iphone # renders index.iphone.erb
                                        end
                                      end
                                     end
Action Pack: Record identification
    # person is a Person object, which by convention will
    # be mapped to person_url for lookup
    redirect_to(person)
    link_to(person.name, person)
    form_for(person)



•
•   URL

•   URL
    •                 :controller=>:user,:action=>:index
    •   form_to(person) person                              (PUT)
                (POST)    form action
Action Pack: HTTP Loving

                                     class PostsController < ApplicationController
                                      USER_NAME, PASSWORD = quot;dhhquot;, quot;secretquot;

                                      before_filter :authenticate, :except => [ :index ]


•   Basic                (      )     def index
                                       render :text => quot;Everyone can see me!quot;
                                      end

•   javascript_include_tag             def edit
                                        render :text => quot;I'm only accessible if you know

    (:all,:cache=>true)             the passwordquot;
                                       end

                                      private

    public/javascripts/all.js          def authenticate
                                         authenticate_or_request_with_http_basic do |
                                    user_name, password|
                                          user_name == USER_NAME && password
                                    == PASSWORD
                                         end
                                       end
                                     end
Action Pack: Security


•           form Ajax
          CSRF
•   XSS
          TextHelper#sanitize
•   HTTP only cookies
Action Pack: Exception handling
     class PostsController < ApplicationController
      rescue_from User::NotAuthorized, :with => :deny_access

      protected
       def deny_access
         ...
       end
     end




 •   rescue_from
Action Pack: Miscellaneous

•       atom    RSS           # index.atom.builder:
                              atom_feed do |feed|
                               feed.title(quot;My great blog!quot;)
                               feed.updated((@posts.first.created_at))

                               for post in @posts

•                                feed.entry(post) do |entry|
                                   entry.title(post.title)
                                   entry.content(post.body, :type => 'html')


    •   asset                     entry.author do |author|
                                   author.name(quot;DHHquot;)

    •                             end
                                end

•                              end
    in_place_editor           end

    auto_complete_for Rails
Active Record: Performance




•   Query
•   fixture   50-100%
Active Record: Sexy migrations
  create_table :people do |t|
   t.column, quot;account_idquot;, :integer
   t.column, quot;first_namequot;, :string, :null => false
   t.column, quot;last_namequot;, :string, :null => false
   t.column, quot;descriptionquot;, :text
   t.column, quot;created_atquot;, :datetime
   t.column, quot;updated_atquot;, :datetime
  end




  create_table :people do |t|
   t.integer :account_id
   t.string :first_name, :last_name, :null => false
   t.text :description
   t.timestamps
  end
Active Record: XML in, JSON out


 •   XML JSON



     Person.new.from_xml(“David“)
     person.to_json
Active Record: Shedding some weight
                 acts_as_XYZ


•   ActiveRecord
        acts_as_XYZ
                             Rails



    ./script/plugin install acts_as_list
Active Record: Shedding some weight
             DB


•       DB            gem
    •
             activerecord-XYZ-adapter
Active Record: with_scope with a dash of syntactic vinegar



   •   .with_scope public            protected
       •
       •
       •   .send(:with_scope)
           with_scope
ActionWebService out, ActiveResource in


•   SOAP vs REST
•   SOAP
•   ActionWebService gem
•   ActiveResource
•   ActiveResource ActiveRecord
ActiveSupport

•
    •   Array#rand
    •   Hash#except
    •   Date
    •   assert_defference
•
Action Mailer


•
•
•   assert_email
Rails: The debugger is back


•   ruby-debug
•          --debugger        -u
•                ./script/breakpointer
Rails: Clean up your environment


•   inflections.rb
•   mime_types.rb              mime type
                    environment.rb         config
Rails: Easier plugin order



•   acts_as_list
•                                   environment.rb
      config.plugins = [ :acts_as_list, :all ]
And hundreds upon hundreds of other improvements




  •
      CHANGELOG
•
• basic
•         with_scope
•

More Related Content

What's hot

Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Rails 2.0 Presentation
Rails 2.0 PresentationRails 2.0 Presentation
Rails 2.0 PresentationScott Chacon
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Elena Kolevska
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and othersYusuke Wada
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Filling the flask
Filling the flaskFilling the flask
Filling the flaskJason Myers
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Securityamiable_indian
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricksbcoca
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
Debugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo SorochanDebugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo SorochanSphere Consulting Inc
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Lar21
 

What's hot (20)

Ruby gems
Ruby gemsRuby gems
Ruby gems
 
Merb
MerbMerb
Merb
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Rails 2.0 Presentation
Rails 2.0 PresentationRails 2.0 Presentation
Rails 2.0 Presentation
 
DataMapper
DataMapperDataMapper
DataMapper
 
Mojo as a_client
Mojo as a_clientMojo as a_client
Mojo as a_client
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Filling the flask
Filling the flaskFilling the flask
Filling the flask
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Security
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Debugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo SorochanDebugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo Sorochan
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18
 

Viewers also liked

地域振興論2009
地域振興論2009地域振興論2009
地域振興論2009xibbar
 
acts_asを使ってみよう
acts_asを使ってみようacts_asを使ってみよう
acts_asを使ってみようxibbar
 
仙台Ruby会議02 Pdf
仙台Ruby会議02 Pdf仙台Ruby会議02 Pdf
仙台Ruby会議02 Pdfxibbar
 
Ruby&Active Support for expert 3
Ruby&Active Support for expert 3Ruby&Active Support for expert 3
Ruby&Active Support for expert 3xibbar
 
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法xibbar
 
Ruby and ActiveSupport for expart
Ruby and ActiveSupport for expartRuby and ActiveSupport for expart
Ruby and ActiveSupport for expartxibbar
 
Tohoku Open Source Conference 2008
Tohoku Open Source Conference 2008Tohoku Open Source Conference 2008
Tohoku Open Source Conference 2008xibbar
 

Viewers also liked (7)

地域振興論2009
地域振興論2009地域振興論2009
地域振興論2009
 
acts_asを使ってみよう
acts_asを使ってみようacts_asを使ってみよう
acts_asを使ってみよう
 
仙台Ruby会議02 Pdf
仙台Ruby会議02 Pdf仙台Ruby会議02 Pdf
仙台Ruby会議02 Pdf
 
Ruby&Active Support for expert 3
Ruby&Active Support for expert 3Ruby&Active Support for expert 3
Ruby&Active Support for expert 3
 
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法
tDiaryなどのレガシーウェブアプリをRuby1.9で動かす方法
 
Ruby and ActiveSupport for expart
Ruby and ActiveSupport for expartRuby and ActiveSupport for expart
Ruby and ActiveSupport for expart
 
Tohoku Open Source Conference 2008
Tohoku Open Source Conference 2008Tohoku Open Source Conference 2008
Tohoku Open Source Conference 2008
 

Similar to Rails2 Pr

Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Railsrstankov
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialYi-Ting Cheng
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the FinishYehuda Katz
 
Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentNicolas Ledez
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Pedro Cunha
 
Ruby on Rails ステップアップ講座 - 大場寧子
Ruby on Rails ステップアップ講座 - 大場寧子Ruby on Rails ステップアップ講座 - 大場寧子
Ruby on Rails ステップアップ講座 - 大場寧子Yasuko Ohba
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Rabble .
 
浜松Rails3道場 其の参 Controller編
浜松Rails3道場 其の参 Controller編浜松Rails3道場 其の参 Controller編
浜松Rails3道場 其の参 Controller編Masakuni Kato
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous MerbMatt Todd
 
Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Rabble .
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
Rails 3 (beta) Roundup
Rails 3 (beta) RoundupRails 3 (beta) Roundup
Rails 3 (beta) RoundupWayne Carter
 

Similar to Rails2 Pr (20)

Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
 
Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirent
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
 
Ruby on Rails ステップアップ講座 - 大場寧子
Ruby on Rails ステップアップ講座 - 大場寧子Ruby on Rails ステップアップ講座 - 大場寧子
Ruby on Rails ステップアップ講座 - 大場寧子
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Ruby talk romania
Ruby talk romaniaRuby talk romania
Ruby talk romania
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Api Design
Api DesignApi Design
Api Design
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
浜松Rails3道場 其の参 Controller編
浜松Rails3道場 其の参 Controller編浜松Rails3道場 其の参 Controller編
浜松Rails3道場 其の参 Controller編
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
 
Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Rails 3 (beta) Roundup
Rails 3 (beta) RoundupRails 3 (beta) Roundup
Rails 3 (beta) Roundup
 

More from xibbar

エンジニア志望だったのにRuby社長をしてよかったと思う5つのこと
エンジニア志望だったのにRuby社長をしてよかったと思う5つのことエンジニア志望だったのにRuby社長をしてよかったと思う5つのこと
エンジニア志望だったのにRuby社長をしてよかったと思う5つのことxibbar
 
札幌Ruby会議03のlt
札幌Ruby会議03のlt札幌Ruby会議03のlt
札幌Ruby会議03のltxibbar
 
Fukushima.rb#00
Fukushima.rb#00Fukushima.rb#00
Fukushima.rb#00xibbar
 
栃木Ruby会議02 Lt途中まで
栃木Ruby会議02 Lt途中まで栃木Ruby会議02 Lt途中まで
栃木Ruby会議02 Lt途中までxibbar
 
1000speakers仙台
1000speakers仙台1000speakers仙台
1000speakers仙台xibbar
 
More Better Nested Set
More Better Nested SetMore Better Nested Set
More Better Nested Setxibbar
 
RubyとActive Support for expert 2
RubyとActive Support for expert 2RubyとActive Support for expert 2
RubyとActive Support for expert 2xibbar
 

More from xibbar (7)

エンジニア志望だったのにRuby社長をしてよかったと思う5つのこと
エンジニア志望だったのにRuby社長をしてよかったと思う5つのことエンジニア志望だったのにRuby社長をしてよかったと思う5つのこと
エンジニア志望だったのにRuby社長をしてよかったと思う5つのこと
 
札幌Ruby会議03のlt
札幌Ruby会議03のlt札幌Ruby会議03のlt
札幌Ruby会議03のlt
 
Fukushima.rb#00
Fukushima.rb#00Fukushima.rb#00
Fukushima.rb#00
 
栃木Ruby会議02 Lt途中まで
栃木Ruby会議02 Lt途中まで栃木Ruby会議02 Lt途中まで
栃木Ruby会議02 Lt途中まで
 
1000speakers仙台
1000speakers仙台1000speakers仙台
1000speakers仙台
 
More Better Nested Set
More Better Nested SetMore Better Nested Set
More Better Nested Set
 
RubyとActive Support for expert 2
RubyとActive Support for expert 2RubyとActive Support for expert 2
RubyとActive Support for expert 2
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Rails2 Pr

  • 1.
  • 2. Rails 2.0 Preview Release • 1.2.4 • 2.0 •
  • 3. Behold, behold, Rails 2.0 is almost here. But before we can slap on the final stamp, we’re going to pass through a couple of trial release phases. The first is this preview release, which allows you to sample the goodies in their almost finished state. • 2.0 • • • by DHH
  • 4. We might change a few things or add something else, but by and large, this is how Rails 2.0 is going to look and feel. After this release have had a chance to be tried out, we’re going to move to a release candidate or two (or three, depending on how many we need). Then, the final release. • 2.0 • •
  • 5. Before the release of 2.0, we’re also going to be putting out 1.2.4, which will include a variety of bug fixes and the last deprecation warnings to get you ready for upgrading an existing application to 2.0 standards. • 2.0 1.2.4 • • • 2.0 deprecation warning
  • 6. Enough about process. Let me tell you a little bit about what’s new in Rails 2.0: • Rails 2.0
  • 7. Action Pack: Resources • • namespace • rake routes routes •
  • 8. Action Pack: Resources map.resources( :users, :has_many => :friends ) config/routes
  • 9. Action Pack: Multiview # should go in config/initializers/mime_types.rb Mime.register_alias quot;text/htmlquot;, :iphone • respond_to class ApplicationController < ActionController::Base before_filter :adjust_format_for_iphone • show.rhtml private show.html.erb def adjust_format_for_iphone if request.env[quot;HTTP_USER_AGENTquot;] && request.env[quot;HTTP_USER_AGENTquot;][/(iPhone|iPod)/] • request.format = :iphone 3.0 show.rhtml deprecated end end • show.csv.erb text/csv CSV end class PostsController < ApplicationController def index respond_to do |format| • − format.html # renders index.html.erb format.iphone # renders index.iphone.erb end end end
  • 10. Action Pack: Record identification # person is a Person object, which by convention will # be mapped to person_url for lookup redirect_to(person) link_to(person.name, person) form_for(person) • • URL • URL • :controller=>:user,:action=>:index • form_to(person) person (PUT) (POST) form action
  • 11. Action Pack: HTTP Loving class PostsController < ApplicationController USER_NAME, PASSWORD = quot;dhhquot;, quot;secretquot; before_filter :authenticate, :except => [ :index ] • Basic ( ) def index render :text => quot;Everyone can see me!quot; end • javascript_include_tag def edit render :text => quot;I'm only accessible if you know (:all,:cache=>true) the passwordquot; end private public/javascripts/all.js def authenticate authenticate_or_request_with_http_basic do | user_name, password| user_name == USER_NAME && password == PASSWORD end end end
  • 12. Action Pack: Security • form Ajax CSRF • XSS TextHelper#sanitize • HTTP only cookies
  • 13. Action Pack: Exception handling class PostsController < ApplicationController rescue_from User::NotAuthorized, :with => :deny_access protected def deny_access ... end end • rescue_from
  • 14. Action Pack: Miscellaneous • atom RSS # index.atom.builder: atom_feed do |feed| feed.title(quot;My great blog!quot;) feed.updated((@posts.first.created_at)) for post in @posts • feed.entry(post) do |entry| entry.title(post.title) entry.content(post.body, :type => 'html') • asset entry.author do |author| author.name(quot;DHHquot;) • end end • end in_place_editor end auto_complete_for Rails
  • 15. Active Record: Performance • Query • fixture 50-100%
  • 16. Active Record: Sexy migrations create_table :people do |t| t.column, quot;account_idquot;, :integer t.column, quot;first_namequot;, :string, :null => false t.column, quot;last_namequot;, :string, :null => false t.column, quot;descriptionquot;, :text t.column, quot;created_atquot;, :datetime t.column, quot;updated_atquot;, :datetime end create_table :people do |t| t.integer :account_id t.string :first_name, :last_name, :null => false t.text :description t.timestamps end
  • 17. Active Record: XML in, JSON out • XML JSON Person.new.from_xml(“David“) person.to_json
  • 18. Active Record: Shedding some weight acts_as_XYZ • ActiveRecord acts_as_XYZ Rails ./script/plugin install acts_as_list
  • 19. Active Record: Shedding some weight DB • DB gem • activerecord-XYZ-adapter
  • 20. Active Record: with_scope with a dash of syntactic vinegar • .with_scope public protected • • • .send(:with_scope) with_scope
  • 21. ActionWebService out, ActiveResource in • SOAP vs REST • SOAP • ActionWebService gem • ActiveResource • ActiveResource ActiveRecord
  • 22. ActiveSupport • • Array#rand • Hash#except • Date • assert_defference •
  • 24. Rails: The debugger is back • ruby-debug • --debugger -u • ./script/breakpointer
  • 25. Rails: Clean up your environment • inflections.rb • mime_types.rb mime type environment.rb config
  • 26. Rails: Easier plugin order • acts_as_list • environment.rb config.plugins = [ :acts_as_list, :all ]
  • 27. And hundreds upon hundreds of other improvements • CHANGELOG
  • 28. • • basic • with_scope •