Class: Mascot::Extensions::RailsRequestPaths
- Inherits:
-
Object
- Object
- Mascot::Extensions::RailsRequestPaths
- Defined in:
- lib/mascot/extensions/rails_request_paths.rb
Overview
Removes the file extension from the file so that /hi/there/fun.html can be resolved via /hi/there/fun.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.format_path(request_path) ⇒ Object
12 13 14 |
# File 'lib/mascot/extensions/rails_request_paths.rb', line 12 def self.format_path(request_path) File.join(File.dirname(File.join("/", request_path)), File.basename(request_path, ".*")) end |
Instance Method Details
#process_resources(resources) ⇒ Object
6 7 8 9 10 |
# File 'lib/mascot/extensions/rails_request_paths.rb', line 6 def process_resources(resources) resources.each do |r| r.request_path = self.class.format_path r.request_path end end |