My gsp has a button and I am not submitting a form. When clicking the button, I want to call a n action in a controller and at the same time I have a jQuery code attached to that button. Even after calling an action in a Controller, hope it stays in the same view(not redirected to the page related to an action).
Any suggestion for a button? g:link, input button does not seem to fit.
Action I want to call is “myAction” and Controller that has ‘myAction’ is “myController”.
Thanks in advance.
g:remoteLink is best solution to your problem dude, you call call jquery or javascript function upon success of your action, here addedCart is javascript function ,after action it gets executed successfully
Ref : grails doc