Monday, May 19, 2014

Using grails for restful services

Well if you use grails for restful services, it saves a lot of time to ensure that you add the following mapping to your controller.


class SubmitterController extends RestfulController{

//response format avoid the error that views are not found
    static responseFormats = ['json']

    static allowedMethods = [list:"GET", save: "POST", update: "POST", delete: "DELETE", show: "GET"]

    public SubmitterController(){
        super(Submitter)
    }


}

once you did this, everything works as it should and it's rather obvious. But sometimes we forget. Nearly as stupid as font-awesome not working fonts, if you use...
< i class="fa-minus-square"></i>

you will only see a stupid utf square. Instead you need to use...
< i class="fa fa-minus-square"></i>

No comments:

Post a Comment