jasper-helpers
jasper-helpers copied to clipboard
Controller Helpers
The html, json, text and xml method helpers simplify setting the response headers.
Tasks:
- [ ] Create a new module in the controllers folder that ports over the following helpers from Kemalyst: https://github.com/kemalyst/kemalyst/blob/master/src/kemalyst/controller.cr#L49-L92
- [ ] Change the macros to def's.
- [ ] Include the module in the controller base class.
Acceptance Criteria:
- [ ] The ability to use templates to render
text, xml, html, json
- [ ] The proper content-type and response code is set
This has been done in amber/controllers/render.cr since it's uses are uniq to amber instead of helpers module.
https://github.com/amberframework/amber/pull/313
@eliasjpr Is this already done?