Class: Cms::Editable
- Inherits:
-
Object
- Object
- Cms::Editable
- Defined in:
- app/models/cms/editable.rb
Class Method Summary collapse
Class Method Details
.content_type(name) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/cms/editable.rb', line 3 def self.content_type(name) case name when /\.css\Z/ "text/css" when /\.js\Z/ "text/javascript" when /\.xml\Z/ "text/xml" when /\.json\Z/ "application/json" when /\.txt\Z/ "text/plain" else "text/html" end end |