diff options
author | Yehuda Katz <wycats@gmail.com> | 2008-12-25 17:12:33 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2008-12-25 17:12:33 -0800 |
commit | 69e349f1bb31c80215775956467fd54e00a2f0fe (patch) | |
tree | 5c1cd0d3e20e7c8f4e07e2ee5e62949a1a5fce22 /actionpack/lib/action_controller/mime_type.rb | |
parent | 061952392afd1dae1aa97a816e9a0c79df7c4514 (diff) | |
download | rails-69e349f1bb31c80215775956467fd54e00a2f0fe.tar.gz rails-69e349f1bb31c80215775956467fd54e00a2f0fe.tar.bz2 rails-69e349f1bb31c80215775956467fd54e00a2f0fe.zip |
Initial work to merge several places with similar logic
Diffstat (limited to 'actionpack/lib/action_controller/mime_type.rb')
-rw-r--r-- | actionpack/lib/action_controller/mime_type.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/mime_type.rb b/actionpack/lib/action_controller/mime_type.rb index 017626ba27..fbc245fa5c 100644 --- a/actionpack/lib/action_controller/mime_type.rb +++ b/actionpack/lib/action_controller/mime_type.rb @@ -5,6 +5,10 @@ module Mime EXTENSION_LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) unless k.blank? } LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) unless k.blank? } + def self.[](type) + Type.lookup_by_extension(type) + end + # Encapsulates the notion of a mime type. Can be used at render time, for example, with: # # class PostsController < ActionController::Base |