Controller Helpers
Opened this issue · 3 comments
eliasjpr commented
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
elorest commented
This has been done in amber/controllers/render.cr since it's uses are uniq to amber instead of helpers module.
elorest commented
faustinoaq commented
@eliasjpr Is this already done?