Sha256: ca84153b6591a3982e95359d4306e4d8b4ae93c36254048b9cb98af76e793d2e

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

class MathjaxRailsController < ActionController::Base
  def index
    ext = ''
    ext = ".#{params[:format]}" if params[:format]
    filename = params[:uri]+ext
    filepath = "../../../vendor/#{MathjaxRails::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.1 lib/mathjax_rails/controller.rb