Class: AssetBundler::AssetsController

Inherits:
ActionController::Metal
  • Object
show all
Includes:
ActionController::MimeResponds, ActionController::Rendering, ActionController::Streaming
Defined in:
app/controllers/asset_bundler/assets_controller.rb

Instance Method Summary collapse

Instance Method Details

#goObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/asset_bundler/assets_controller.rb', line 12

def go
  # Always cache resources. It's the responsibility of the asset tag to
  # invalidate the browser cache with a cache-busting query string.
  headers['Cache-Control'] = 'public'
  headers['Expires']       = 1.year.from_now.httpdate

  begin
    template = find_template(File.join(self.controller_name, self.expansion_for(params[:path])))
    send_file template.identifier,
              :type => formats.first,
              :disposition => 'inline'
  rescue
    raise(ActionController::RoutingError,
          "No route matches #{ request.path.inspect }")
  end
end