Franky So
Franky So

Reputation: 171

Load Controller from View in Grails

As an example I use an controller called "Akun"

package myipaymu

class AkunController {    
    def index() {}
    def profil() {}
}

In my view I want to load "profil" action just like iframe in html, but not iframe.

---------------------------------------
|          index                      |
|                                     |
|     ---------------------------     |
|     | profil                  |     |
|     |                         |     |
|     --------------------------      |
---------------------------------------

I think I can use <g: but I don't really understand how it works. can any one help me? Or suggest where I can find the tutorial??

Upvotes: 0

Views: 122

Answers (1)

D&#243;nal
D&#243;nal

Reputation: 187529

If I understand correctly, you want to include the response from the profil controller action within a GSP? The easiest way to do this is with the g:include tag, e.g.

---------------------------------------
|          index                      |
|                                     |
| ---------------------------------   |
| | <g:include action="profil"/>  |   |
| |                               |   |
| ---------------------------------   |
---------------------------------------

Upvotes: 2

Related Questions