Sha256: 8dbe3d1b989b7a51b1c02aea2bf907d0cfab0c3f090c1608f8358abd3e1984d7

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

class Mathjax::Rails::MathjaxRailsController < ActionController::Base
  def giveOutStaticFile
    ext = ''
    ext = ".#{params[:format]}" if params[:format]
    filename = params[:uri]+ext
    filepath = "../../../../vendor/#{Mathjax::Rails::DIRNAME}/es5/#{filename}"

    extname = File.extname(filename)[1..-1]
    mime_type = Mime::Type.lookup_by_extension(extname)
    options = Hash.new
    options[:type] = mime_type.to_s unless mime_type.nil?
    options[:disposition] = 'inline'
    file = File.expand_path(filepath, __FILE__)
    if File.exists?(file)
      send_file file, options
    else
      raise ActionController::RoutingError.new('')
    end
  end

  def verify_authenticity_token
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mathjax-rails-3-3.2.2.2 lib/mathjax/rails/controllers.rb