You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# assume these are always in `./src/pages/`# Also default assume content_type is HTML, but allow for an override
render_ecr "posts/index.ecr"defrender_ecr(page_path : String, content_type : String= html_content_type, status : Int32? =nil) : Lucky::TextResponse
send_text_response ECR.render(Path["#{Dir.current}/src/pages/#{page_path}"]),
content_type: content_type,
status: status
end
Only wonky thing I'm not a fan of is that variables have to be defined in this weird floating area. You'd have to tell Ameba to ignore these because they'd be used in the template. But this would be fairly close to how Kemal works https://kemalcr.com/guide/#views-templates
The text was updated successfully, but these errors were encountered:
We have docs on setting up Kilt and using ECR embedded in your page https://luckyframework.org/guides/frontend/rendering-html#rendering-html-with-templates-ecr-slang-etc
But this setup is a bit complicated since it relies on you setting up a full Lucky::Page then embedding your ECR within it.
You can also use ECR directly from your action, but it's not as straight forward, and not documented:
We should just make a method like
Only wonky thing I'm not a fan of is that variables have to be defined in this weird floating area. You'd have to tell Ameba to ignore these because they'd be used in the template. But this would be fairly close to how Kemal works https://kemalcr.com/guide/#views-templates
The text was updated successfully, but these errors were encountered: