Sha256: e483720c98d16d0a6e61182c026b6680ba4b72dcefe400dba035a4177059ae93

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 Bytes

Contents

class AdminData::PublicController < AdminData::BaseController

  def serve
    f = File.join(AdminData::Config.setting[:plugin_dir], 'lib', params[:file])
    if not File.exists? f then
      return render :nothing => true, :status => 404
    end
    opts = {:text => File.new(f).read, :cache => true}
    if f =~ /css$/ then
      opts[:content_type] = "text/css"
    elsif f =~ /js$/ then
      opts[:content_type] = "text/javascript"
    end
    render opts
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
admin_data-1.0.21 app/controllers/admin_data/public_controller.rb