I want to show select box in GSP with some values from DB table.
Following code works fine
<% List a = test.demo.MyCategory.findAll("from MyCategory where is_deleted = false"); %>
<g:select name="myCategory.id" from="${a}" optionKey="id" optionValue="name" />
But when I try this by writing query directly in tag, it doesn’t work.
<g:select name="myCategory.id" from="${test.demo.RecipeCategory.findAll("from MyCategory where is_deleted = false")}" optionKey="id" optionValue="name" />
I got the answer