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

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

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 •