kemal icon indicating copy to clipboard operation
kemal copied to clipboard

Missing helpers method to define helper methods for use in route handlers and templates

Open drum445 opened this issue 4 years ago • 0 comments

Not a bug, just a query really. In Sinatra it has a helpers method where we can add any custom helpers we may have, I used this a lot for is_logged_in, etc...

In Kemal is the idea we would just have a file of these anonymous functions, as when called from a route we will still be in the request's scope gate and can access all the methods/vars we would expect (request, session, etc...) ? This is of course, also possibly in Ruby, but the explicit helpers method Sinatra provides helps keep things more explicit without leaking scope.

Many Thanks.

drum445 avatar Feb 07 '22 10:02 drum445