Skip to content

Instantly share code, notes, and snippets.

@kares
Forked from Hakon/rackup.ru
Created May 23, 2012 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kares/2774140 to your computer and use it in GitHub Desktop.
Save kares/2774140 to your computer and use it in GitHub Desktop.
JRuby::Rack with Rails send_file bug
require 'rubygems'
%w(action_controller/railtie).map &method(:require)
class JrubyRackTest < Rails::Application
config.secret_token = routes.append { root :to => 'send_file#deliver' }.inspect
initialize!
end
run JrubyRackTest
class SendFileController < ActionController::Base
def deliver
if params[:txt]
send_file Rails.root.join("synaptic.txt")
else
send_file Rails.root.join("image.jpg")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment