Skip to content

Instantly share code, notes, and snippets.

@babatakao

babatakao/config.ru

Created Oct 30, 2012
Embed
What would you like to do?
Rails 3.2でproduction環境の時にHEADメソッド(request.head?)が動作しない不具合を修正するパッチ
# This file is used by Rack-based servers to start the application.
class SaveOriginalHttpMethod
def initialize(app)
@app = app
end
def call(env)
env['rack.methodoverride.original_method'] = env['REQUEST_METHOD']
@app.call(env)
end
end
use SaveOriginalHttpMethod
require ::File.expand_path('../config/environment', __FILE__)
run MyApp::Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment