0

Is it possible to access the application's configurations using the grailsApplication object in scaffolding templates?

For example:

If I have this in my application.yml file

customconfig:
    layout: foo

Is there a way for me to get this value in my file \src\main\templates\scaffolding\index.gsp by doing something like:

<meta name="layout" content="${grailsApplication.config.customconfig.layout}" />

I would like the code in my generated view to be:

<meta name="layout" content="foo" />

Everything I've tried so far give me an error when trying to generate my view:

Error occurred running Grails CLI: No such property: grails for class: groovy.lang.Binding

I am using Grails 3.0.11

I appreciate any help! Thanks.

NBabineau
  • 19
  • 3

0 Answers0