jasper-helpers icon indicating copy to clipboard operation
jasper-helpers copied to clipboard

Controller Helpers

Open eliasjpr opened this issue 7 years ago • 3 comments

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

eliasjpr avatar Jun 07 '17 13:06 eliasjpr

This has been done in amber/controllers/render.cr since it's uses are uniq to amber instead of helpers module.

elorest avatar Nov 02 '17 04:11 elorest

https://github.com/amberframework/amber/pull/313

elorest avatar Nov 02 '17 04:11 elorest

@eliasjpr Is this already done?

faustinoaq avatar Jun 12 '18 19:06 faustinoaq