Sha256: 3c7f99c782ac29715be513a837e39581b059c304526bdfe61a5a97a5c48748b4
Contents?: true
Size: 542 Bytes
Versions: 1
Compression:
Stored size: 542 Bytes
Contents
class MathjaxRailsController < ActionController::Base def giveOutStaticFile ext = '' ext = ".#{params[:format]}" if params[:format] filename = params[:uri]+ext filepath = "../../../../vendor/#{Mathjax::Rails::DIRNAME}/#{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' send_file File.expand_path(filepath,__FILE__), options end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mathjax-rails-0.0.4 | lib/mathjax/rails/controllers.rb |