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

Changeset 5207

Show
Ignore:
Timestamp:
09/29/06 08:26:45 (2 years ago)
Author:
bitsweat
Message:

Deprecate @response

Files:

Legend:

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

    r5206 r5207  
    33* assert_select_rjs decodes escaped unicode chars since the Javascript generators encode them.  #6240 [japgolly] 
    44 
    5 * Deprecation: @cookies, @headers, @request will be removed after 1.2. Use the corresponding method instead.  [Jeremy Kemper] 
     5* Deprecation: @cookies, @headers, @request, @response will be removed after 1.2. Use the corresponding method instead.  [Jeremy Kemper] 
    66 
    77* Make the :status parameter expand to the default message for that status code if it is an integer. Also support symbol statuses. [Jamis Buck]. Examples: 
  • trunk/actionpack/lib/action_controller/base.rb

    r5206 r5207  
    305305    # has been rendered through response.body -- useful for <tt>after_filter</tt>s that wants to manipulate the output, 
    306306    # such as a OutputCompressionFilter. 
    307     attr_accessor :response 
     307    attr_internal :response 
    308308 
    309309    # Holds a hash of objects in the session. Accessed like <tt>session[:person]</tt> to get the object tied to the "person" 
     
    10171017        @_request, @_params, @_cookies = request, request.parameters, request.cookies 
    10181018 
    1019         @response         = response 
    1020         @response.session = request.session 
    1021  
    1022         @_session = @response.session 
    1023         @template = @response.template 
    1024         @assigns  = @response.template.assigns 
    1025  
    1026         @_headers = @response.headers 
     1019        @_response         = response 
     1020        @_response.session = request.session 
     1021 
     1022        @_session = @_response.session 
     1023        @template = @_response.template 
     1024        @assigns  = @_response.template.assigns 
     1025 
     1026        @_headers = @_response.headers 
    10271027 
    10281028        assign_deprecated_shortcuts(request, response) 
     
    11291129        else 
    11301130          %w(@assigns @performed_redirect @performed_render 
    1131              @_request @request @response @_params @params @_session @session 
    1132              @_cookies @cookies @template @request_origin @parent_controller) 
     1131             @_request @request @_response @response @_params @params 
     1132             @_session @session @_cookies @cookies 
     1133             @template @request_origin @parent_controller) 
    11331134        end 
    11341135      end 
  • trunk/actionpack/lib/action_controller/caching.rb

    r5129 r5207  
    126126      end 
    127127 
    128       # Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of @response.body is used 
     128      # Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of response.body is used 
    129129      # If no options are provided, the current +options+ for this action is used. Example: 
    130130      #   cache_page "I'm the cached content", :controller => "lists", :action => "show" 
    131131      def cache_page(content = nil, options = {}) 
    132132        return unless perform_caching && caching_allowed 
    133         self.class.cache_page(content || @response.body, url_for(options.merge({ :only_path => true, :skip_relative_url_root => true }))) 
     133        self.class.cache_page(content || response.body, url_for(options.merge({ :only_path => true, :skip_relative_url_root => true }))) 
    134134      end 
    135135 
    136136      private 
    137137        def caching_allowed 
    138           !@request.post? && @response.headers['Status'] && @response.headers['Status'].to_i < 400 
     138          !@request.post? && response.headers['Status'] && response.headers['Status'].to_i < 400 
    139139        end 
    140140    end 
     
    185185      end 
    186186 
    187       class ActionCacheFilter #:nodoc:         
     187      class ActionCacheFilter #:nodoc: 
    188188        def initialize(*actions, &block) 
    189189          @actions = actions 
  • trunk/actionpack/lib/action_controller/components.rb

    r5201 r5207  
    127127          klass    = component_class(options) 
    128128          request  = request_for_component(klass.controller_name, options) 
    129           response = reuse_response ? @response : @response.dup 
     129          new_response = reuse_response ? response : response.dup 
    130130 
    131           klass.process_with_components(request, response, self) 
     131          klass.process_with_components(request, new_response, self) 
    132132        end 
    133          
     133 
    134134        # determine the controller class for the component request 
    135135        def component_class(options) 
  • trunk/actionpack/lib/action_controller/cookies.rb

    r5205 r5207  
    3434      # Deprecated cookie writer method 
    3535      def cookie(*options) 
    36         @response.headers["cookie"] << CGI::Cookie.new(*options) 
     36        response.headers['cookie'] << CGI::Cookie.new(*options) 
    3737      end 
    3838  end 
  • trunk/actionpack/lib/action_controller/layout.rb

    r4728 r5207  
    251251        add_variables_to_assigns 
    252252        @template.instance_variable_set("@content_for_layout", content_for_layout) 
    253         @response.layout = layout 
     253        response.layout = layout 
    254254        render_text(@template.render_file(layout, true), deprecated_status) 
    255255      else 
  • trunk/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml

    r4715 r5207  
    99  <br /><br /> 
    1010  <% begin %> 
    11     <%= form_tag(@request.request_uri, "method" => @request.method) %> 
     11    <%= form_tag(request.request_uri, "method" => request.method) %> 
    1212      <input type="hidden" name="BP-RETRY" value="1" /> 
    1313   
     
    2727 
    2828<% 
    29   request_parameters_without_action = @request.parameters.clone 
     29  request_parameters_without_action = request.parameters.clone 
    3030  request_parameters_without_action.delete("action") 
    3131  request_parameters_without_action.delete("controller") 
     
    3838 
    3939<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p> 
    40 <div id="session_dump" style="display:none"><%= debug(@request.session.instance_variable_get("@data")) %></div> 
     40<div id="session_dump" style="display:none"><%= debug(request.session.instance_variable_get("@data")) %></div> 
    4141 
    4242 
    4343<h2 style="margin-top: 30px">Response</h2> 
    44 <b>Headers</b>: <%=h @response.headers.inspect.gsub(/,/, ",\n") %><br/> 
     44<b>Headers</b>: <%=h response.headers.inspect.gsub(/,/, ",\n") %><br/> 
  • trunk/actionpack/lib/action_controller/templates/rescues/template_error.rhtml

    r2624 r5207  
    11<h1> 
    22  <%=h @exception.original_exception.class.to_s %> in 
    3   <%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> 
     3  <%=h request.parameters["controller"].capitalize if request.parameters["controller"]%>#<%=h request.parameters["action"] %> 
    44</h1> 
    55