Rails provides an excellent XML Builder by default to build RSS and ATOM feeds, but nothing to help you build complex and custom JSON data structures. JSON Builder is here to help.
The issue here is you are using json.float = 1.3 as a setter, if you remove the = you would get expected results. The new API in 3.0 should help as well.