diff options
author | wycats <wycats@gmail.com> | 2010-10-10 00:51:52 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-10-10 00:54:11 -0700 |
commit | 8cb2cfbf71092f95090335cbdde0340cc74db748 (patch) | |
tree | 768eaff354b8644bdaf0906b4c3933b7a00a20bc /actionpack/lib/action_controller | |
parent | 38d78f99d52801d8392a7229b40edae74cc3d142 (diff) | |
download | rails-8cb2cfbf71092f95090335cbdde0340cc74db748.tar.gz rails-8cb2cfbf71092f95090335cbdde0340cc74db748.tar.bz2 rails-8cb2cfbf71092f95090335cbdde0340cc74db748.zip |
Fix a few bugs when trying to use Head standalone
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 5 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/head.rb | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index ace1aabe03..329798e84f 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -119,6 +119,11 @@ module ActionController headers["Location"] = url end + # basic url_for that can be overridden for more robust functionality + def url_for(string) + string + end + def status @_status end diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb index 2b4a3b9392..8abcad55a2 100644 --- a/actionpack/lib/action_controller/metal/head.rb +++ b/actionpack/lib/action_controller/metal/head.rb @@ -2,8 +2,6 @@ module ActionController module Head extend ActiveSupport::Concern - include ActionController::UrlFor - # Return a response that has no content (merely headers). The options # argument is interpreted to be a hash of header names and values. # This allows you to easily return a response that consists only of @@ -27,8 +25,8 @@ module ActionController self.status = status self.location = url_for(location) if location - self.content_type = Mime[formats.first] + self.content_type = Mime[formats.first] if formats self.response_body = " " end end -end
\ No newline at end of file +end |