hashrocket / decent_exposure

A helper for creating declarative interfaces in controllers
MIT License
1.81k stars 107 forks source link

Specify http status code #129

Closed Bartuz closed 8 years ago

Bartuz commented 9 years ago

My controller's action looks like this now: respond_with(model, status: use_case.http_status, location: root_url)

Is it possible to specify http status code with exposure?

brendon commented 8 years ago

Hi @Bartuz, I'm not sure why you'd want to do this. decent_exposure doesn't seem to be concerned with how you respond from actions, just with providing methods for accessing models etc... within the controller. That's why all the examples either show the traditional render/redirect code or respond_with.

It's definitely better for clarity if you have the status explicitly set there. If you're doing it a lot, perhaps there's a way to set it per controller with a proc or something?