I'm fairly new to Grails and today was following a tutorial on spicing up Grails with Ajax (prototype). The tutorial was simple quote of the day Grails app that would asynchronously fetch random quote from the db. I've spent almost 3 hours getting ajax to work, finally got it to work with weird outcome. Basically, ajax wouldn't work unless I put the following two lines to both gsp of the view and gsp of the layout:
<g:javascript library="prototype" />
<r:layoutResources />
I tried to put the above lines into either one, but that wouldn't work. It had to be in both places. Is that the expected behavior of grails?