From 40659aaab3046d2e621ae4db5facc35955a9df4c Mon Sep 17 00:00:00 2001 From: "Elias J. Perez" Date: Fri, 11 Nov 2022 16:56:38 -0500 Subject: [PATCH] (MINOR) Drops render method in favor of view When using Templates::Renderable the method render has been replaced with `view` this is to remove redundancy from the Response#render method. To upgrade simply rename render to view for all classes, structs that uses Templates::Renderable --- playground/responses/html_response.cr | 2 +- src/azu/templates.cr | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/playground/responses/html_response.cr b/playground/responses/html_response.cr index 384395e..34da776 100644 --- a/playground/responses/html_response.cr +++ b/playground/responses/html_response.cr @@ -7,7 +7,7 @@ module ExampleApp end def render - render "example.html", {name: @name} + view "example.html", {name: @name} end end end diff --git a/src/azu/templates.cr b/src/azu/templates.cr index 045481c..1e89784 100644 --- a/src/azu/templates.cr +++ b/src/azu/templates.cr @@ -24,10 +24,6 @@ module Azu CONFIG.templates.load(template).render(data) end - private def render(template : String = page_path, data = Hash(String, String).new) - view template, data - end - def page_path "#{self.class.name.split("::")[1..-1].join("/").underscore.downcase}.jinja" end