Closed jeffbdavenport closed 1 year ago
@jeffreydvp thank you for submitting this issue. If you have a fix please feel free to open a pull request. It looks like the source of the issue is in the generators.
Let me know if you would like to submit a fix.
Well I just commented it out and created the application.slim I’m not sure why that didn’t exist.
@jeffreydvp What's the error message? Is it:
Which expanded to:
> 1 | Kilt.render("#{"src/views"}/"layouts/#{false}"")
^
Error: expecting token ')', not 'layouts'
2020-08-15T16:51:46.322333Z INFO - watch.run: Compile time errors detected, exiting...
12:51:46 watch.run (Info) Compile time errors detected, exiting...
Reproduced By: Creating a new project, setting LAYOUT
to false
in application_controller.cr
& building.
@eliasjpr I just tested. If my error is correct, It's failing in render_template
at Kilt.render
because of line 27:
render_template("layouts/#{{{layout.class_name == "StringLiteral" ? layout : LAYOUT}}}", {{path}})
It's converting the bool false
to "false"
and then trying to find that layout. This might be something we want to fix because the only non-hacky solution is setting layout: false
in every controller that invokes render
.
@jefferydvp your solution works for now which is awesome. If you would like to have a layout but one (or a few) controllers don't have said layout, invoke render like:
render("my_view", layout: false)
Closing this because the fix as been merged. Thank you @drujensen!
Description
With the default setup of a brand new Amber and an example scaffold, it creates the application.cr to look like this
Steps to Reproduce
If you comment out the
LAYOUT = false
and create theapplication.slang
file, everything works as normalExpected behavior: It should render just fine
Actual behavior: All the pages being rendered generate some strange macro errors.
Reproduces how often: 100% of the time
Versions
Amber CLI (amberframework.org) - v0.35.0 Crystal 0.35.1 [5999ae29b] (2020-06-19) LLVM: 8.0.0 Default target: x86_64-unknown-linux-gnu