After much discussion with the grails dev team I've been informed that my understanding of how this should work is not the way Grails works. I assumed (incorrectly) that because the data binding added the TaskFilter to the Task that it would behave as if addToFilters() was called on the...
rest,grails,spring-security,grails-plugin,grails-2.4
Try this $.ajax({ url: " http://localhost:8080/AppName/api/login", type: "POST", crossDomain: true, data: JSON.stringify({"username":"yourusername" , "password":"yourpassword"}), contentType: 'application/json; charset=utf-8', dataType: "json", success: function (response) { console.log(response); }, error: function (xhr, status) { alert("error"); } }) }); ...
static constraints = { deleted bindable: true } ...
Use namespaces for your controller. class BookController { static namespace = 'namespaceOne' // … } and then use the namespace to generate links to your BookController. <g:link controller="book" namespace="namespaceOne">Click me</g:link> ...
unit-testing,grails,spock,traits,grails-2.4
Groovy's type coercion can be used to add behaviours from a trait to a class at runtime. class MyTraitSpec extends Specification { @Shared MyTrait testInstance = new Object() as MyTrait // ... } You should be aware that this creates a proxied instance, although the documentation (http://beta.groovy-lang.org/docs/groovy-2.3.0/html/documentation/core-traits.html#_runtime_implementation_of_traits) says the proxy...
grails,datatables,datatables-1.10,grails-2.4
In your DataTables initialization code you need to use option fnServerParams to modify data sent to the server. I have also corrected deferLoading which should be iDeferLoading, see iDeferLoading. Below is modified DataTables initalization code: $('#example').dataTable({ "sPaginationType": "full_numbers", "bAutoWidth": true, "bServerSide": true, "iDisplayLength": 10, "iDeferLoading": ${totalCount?:0}, "sAjaxSource": "${g.createLink(controller: 'androidGame',action: 'ajaxAndroidGameList')}",...