Suppose Author
belongs_to Boook
.
Is it possible to do the same as in Rails templates in a Freemarker template:
"author": ${book.author.last_name}
I tried without success. May be my syntax is wrong or I'm missing something ?
Suppose Author
belongs_to Boook
.
Is it possible to do the same as in Rails templates in a Freemarker template:
"author": ${book.author.last_name}
I tried without success. May be my syntax is wrong or I'm missing something ?
You would need to use the
include()
and pre-load objects for this. Please, see: http://javalite.io/lazy_and_eager#eager-simultaneous-loading-of-parents-and-childrenYou would need to experiment with code a little. In the worst case, you can add a method to a model and call that from a template.