Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4637

Show
Ignore:
Timestamp:
07/31/06 18:59:58 (2 years ago)
Author:
david
Message:

Added map.resources from the Simply Restful plugin (backwards incompatible with the plugin!) [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4634 r4637  
    11*SVN* 
     2 
     3* Added map.resources from the Simply Restful plugin [DHH]. Examples (the API has changed to use plurals!): 
     4 
     5    map.resources :messages 
     6    map.resources :messages, :comments 
     7    map.resources :messages, :new => { :preview => :post } 
    28 
    39* Fixed that integration simulation of XHRs should set Accept header as well [Edward Frederick] 
  • trunk/actionpack/lib/action_controller/base.rb

    r4590 r4637  
    33require 'action_controller/response' 
    44require 'action_controller/routing' 
     5require 'action_controller/resources' 
    56require 'action_controller/url_rewriter' 
    67require 'drb' 
  • trunk/actionpack/lib/action_controller/request.rb

    r4277 r4637  
    1616    # Returns the HTTP request method as a lowercase symbol (:get, for example) 
    1717    def method 
    18       @request_method ||= @env['REQUEST_METHOD'].downcase.to_sym 
     18      @request_method ||= (method = parameters[:_method] && method == :post) ? 
     19        method.to_s.downcase.to_sym : 
     20        @env['REQUEST_METHOD'].downcase.to_sym 
    1921    end 
    2022 
  • trunk/actionpack/lib/action_controller/routing.rb

    r4625 r4637  
    5959      end 
    6060 
    61       def normalize_paths(paths=$LOAD_PATH) 
     61      def normalize_paths(paths = $LOAD_PATH) 
    6262        # do the hokey-pokey of path normalization... 
    6363        paths = paths.collect do |path| 
     
    352352   
    353353    protected 
    354    
    355354      def requirement_for(key) 
    356355        return requirements[key] if requirements.key? key 
     
    416415        false 
    417416      end 
    418    
    419417    end 
    420418 
     
    451449        value 
    452450      end 
    453    
    454451    end 
    455452 
    456453    class DividerSegment < StaticSegment 
    457    
    458454      def initialize(value = nil) 
    459455        super(value) 
     
    465461        true 
    466462      end 
    467    
    468463    end 
    469464 
     
    761756 
    762757    class RouteSet 
    763    
    764758      # Mapper instances are used to build routes. The object passed to the draw 
    765759      # block in config/routes.rb is a Mapper instance. 
     
    840834 
    841835        private 
    842  
    843836          def url_helper_name(name, kind = :url) 
    844837            :"#{name}_#{kind}"