]> git.openstreetmap.org Git - rails.git/blob - config/initializers/action_cache_path.rb
Allow cross-origin requests to API
[rails.git] / config / initializers / action_cache_path.rb
1 module ActionController
2   module Caching
3     module Actions
4       class ActionCachePath
5         def initialize(controller, options = {}, infer_extension = true)
6           if infer_extension
7             @extension = controller.params[:format]
8             options.reverse_merge!(:format => @extension) if options.is_a?(Hash)
9           else
10             @extension = options[:format]
11           end
12
13           path = controller.url_for(options).split(%r{://}).last
14           @path = normalize!(path)
15         end
16       end
17     end
18   end
19 end