我想使用机架中间件打印模板正文。下面是我的设置...
#config/initializers/response_timer.rb
class ResponseTimer
def initialize(app)
@app = app
end
def call(env)
status, headers, response = @app.call(env)
[status, headers, response.body]
end
end
#application.rb file
config.middleware.use "ResponseTimer"
当我提出请求域名/学生/我得到以下错误。
undefined method `each' for #<String:0xd69a2e0>
请帮忙。