sync rack request and response
问题 In my rails 4 app I'd like to response with html both for html and js request. At the moment when the request is html type the rendering works fine, but when the request is js then the html file doesn't get rendered on the screen (although in the command line it says it's rendered). There are different scenarios for limiting requests so the throttle code can be triggered by html POST and js POST request as well. Rack::Attack.throttle(key, limit: from_config(key, :limit), period: from_config