Sharing the Code

Programming stuff that might be useful to others

Tag: Server-side

A basic ajax form in Rails

This basic example shows you how you can submit a form without having to refresh the page. This might be useful, for example, when you want to do inline editing. The following example allows you to update the name of an item without affecting anything else that might be on the page.

Read more

Grails and dynamic controller names in UrlMappings

I was creating some REST web services and I needed to map a URL like “/api/1.0/recipes” to a controller called RecipesRestController. It took me a while to work out how to generate a dynamic controller name from the request path. The trick is not to use $controller, it doesn’t seem to work, so instead I renamed it $aController.

Read more