rubyhanami

Setting http status but keep normal view?


How can I set different http status but keep normal view? Currently I have these two lines in my action

self.status = 403
self.body = Web::Views::Login::Form.render(exposures)

However my problems is that I get complete different page, just gray page with big rectangle in the middle with with HTML text of self.body (escaped, so I see the actual source code, not the page).

So, how can I set reponse code while keeping regular view processing (== displaying self.body)?


Solution

  • Not possible to do at the moment, see https://github.com/hanami/hanami/issues/874 for workaround.