Remote Methods Plugin

  • Tags: javascript, remote
  • Latest: 0.2
  • Last Updated: 20 December 2012
  • Grails version: 2.0 > *
1 vote
Dependency:
compile ":grails-remote-methods:0.2"

 Documentation  Source  Issues

Summary

Allow controller methods to call from JS without any code.

Installation

grails install-plugin grails-remote-methods

Description

Usage:
  1. Define on gsp (all attributes are optional, you can specify remote methods in controller as static property 'remoteMethods')
<rm:defineRemote controller="index" methods="['user_info']"/>

2. Call any remote method from your js like this:

index.user_info(
            {test: '123'}, 
            function(data) {
                console.log(data);
            },
            function() {
              console.log(arguments);
            }
        )
(errror function is optinal)