Sha256: c8985fabc4f2aac55d17eb3623d949e2b8f85290a99909a35ef76446fe1c40bd

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

class EngineAssets::AssetsController < ActionController::Base
  layout        nil
  before_filter :expire, :set_headers
  after_filter  :cache

  def show
    flat_file = EngineAssets::PublicLocator.locate(File.join(controller_name, [params[:path], params[:format]].join('.')))
    if(flat_file)
      render(:file => flat_file)
    else
      begin
        render(:template => File.join('engine_assets', controller_name, params[:path]), :layout => false)
      rescue ActionView::MissingTemplate
        head :not_found
      end
    end
  end


  private

  def expire
    # TODO
    # expire_page :controller => self, :action => "all"
  end

  def cache
    cache_page
  end

  def set_headers
    # optionally override
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engine-assets-0.4.2 app/controllers/engine_assets/assets_controller.rb