-
-
Save kares/2774140 to your computer and use it in GitHub Desktop.
JRuby::Rack with Rails send_file bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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