grails - controller logic for gsp templates -



grails - controller logic for gsp templates -

i'm working on organizing gsp's templates. problem of them require fair amount of controller type logic (fetching info based on current request, massaging before display, etc). seems have 2 options:

do controller type work in template using taglibs , scriptlet. seems poor separation of view , controller. plus gets quite ugly quite quickly. do controller type work in every controller uses template. not dry.

neither of these seem quite mvc me. i'm looking way phone call gsp template has it's own controller. there such thing in grails?

thanks,

the proper way reuse template (as have defined here) include phone call owning controller other gsp. such as:

<g:include controller="myfancycontrollername" action="actionthatrenderstemplate" />

in doing ensuring logic builds model used template kept within controller calling , don't have repeat anywhere else.

grails grails-2.0 gsp

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -