aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-01 16:29:11 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-01 16:29:11 +0000
commit250a570c0436c6918101e075388b39e59f1e7246 (patch)
tree63b41e66f842abfdc9ee29873945b2917e456f6b /actionpack/lib/action_controller
parent7ad83b8df2d1b4d4a6ec81903eac48b7248ebd89 (diff)
downloadrails-250a570c0436c6918101e075388b39e59f1e7246.tar.gz
rails-250a570c0436c6918101e075388b39e59f1e7246.tar.bz2
rails-250a570c0436c6918101e075388b39e59f1e7246.zip
Added class declaration for the MissingFile exception #388 [Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rwxr-xr-xactionpack/lib/action_controller/base.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 6d9278266d..c061b895d3 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -14,6 +14,8 @@ module ActionController #:nodoc:
end
class UnknownAction < ActionControllerError #:nodoc:
end
+ class MissingFile < ActionControllerError #:nodoc:
+ end
# Action Controllers are made up of one or more actions that performs its purpose and then either renders a template or
# redirects to another action. An action is defined as a public method on the controller, which will automatically be
@@ -432,7 +434,7 @@ module ActionController #:nodoc:
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# for the Cache-Control header spec.
def send_file(path, options = {}) #:doc:
- raise MissingFile unless File.file?(path) and File.readable?(path)
+ raise MissingFile, path unless File.file?(path) and File.readable?(path)
options[:length] ||= File.size(path)
options[:filename] ||= File.basename(path)