diff options
Diffstat (limited to 'actionpack/lib/action_controller/metal.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index eebd2c943a..30aa34d956 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -34,11 +34,12 @@ module ActionController # and response object available. You might wish to control the # environment and response manually for performance reasons. - attr_internal :status, :headers, :content_type, :response, :request + attr_internal :headers, :response, :request delegate :session, :to => "@_request" def initialize(*) - @_headers = {} + @_headers = {"Content-Type" => "text/html"} + @_status = 200 super end @@ -62,10 +63,19 @@ module ActionController headers["Location"] = url end + def status + @_status + end + def status=(status) @_status = Rack::Utils.status_code(status) end + def response_body=(val) + body = val.respond_to?(:each) ? val : [val] + super body + end + # :api: private def dispatch(name, request) @_request = request |