Lets see some rails people figure out how to do this as dead simply as in spring-roo on java.
project --topLevelPackage com.my.web.my.restful.resources
persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity --class ~.domain.Resource1
field string --fieldName myfirstfield
field string --fieldName mysecondfield
controller all --package ~.controllers
osgi start --url http://spring-roo-addons.googlecode.com/files/net.tzolov.httprepresentations.roo.addon-1.1.7.jar
http resource representation setup
http resource add oxm --class ~.domain.Resource1
json/html conversion works out of the box without modification however you need to annotate the model objects you want converted to xml by jaxb with @XmlRootElement so it knows what you want returned.
open up http://localhost:8080/resources in your browser and create some data on the auto-generated controllers.
access it via your browser or curl by simply appending .json .xml extensions to the url.
also check out this springsource post about hitting json rest based services with curl.