I have to populate a select box with all avaliable Disciplines that are stored in my DB.
So, in DisciplineController I created an action like this:
def getDisciplinesJson() {
def discList = Discipline.getAll()
return discList as JSON
}
Is that the right way to get disciplines as JSON, and how do I call this action and, using Javascript for example, populate a select box, something like this:
<select id=disc-select> </select>
This select box appears in other page, Student create, for example.