Skip to content

Commit

Permalink
(MINOR) Drops render method in favor of view
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eliasjpr committed Nov 11, 2022
1 parent c491274 commit 40659aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion playground/responses/html_response.cr
Expand Up @@ -7,7 +7,7 @@ module ExampleApp
end

def render
render "example.html", {name: @name}
view "example.html", {name: @name}
end
end
end
4 changes: 0 additions & 4 deletions src/azu/templates.cr
Expand Up @@ -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
Expand Down

0 comments on commit 40659aa

Please sign in to comment.