Guest User

Untitled

a guest
Apr 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import grails.converters.*
  2.  
  3. class CourseController {
  4. def index = { redirect(action:list,params:params) }
  5. // the delete, save and update actions only accept POST requests
  6. static allowedMethods = [delete:'POST', save:'POST', update:'POST']
  7.  
  8. def list = {
  9. params.max = Math.min( params.max ? params.max.toInteger() : 10, 100)
  10. //[ courseInstanceList: Course.list( params ) , courseInstanceTotal: Course.count() ]
  11. def courses = Course.list( params )
  12. // return a bunch of json data with metadata.
  13. def json = [
  14. totalCount: courses.size,
  15. results: courses
  16. ]
  17.  
  18. render json as JSON
  19.  
  20.  
  21. }
  22. //other methods.... that i didn't touch
  23. }
  24.  
  25. unable to resolve class org.codehaus.groovy.grails.co
  26. mmons.metaclass.ExpandoMetaClass
  27. @ line 4, column 1.
  28. import org.codehaus.groovy.grails.commons.metaclass.ExpandoMetaClass
Add Comment
Please, Sign In to add comment