Get updates

Archive for April, 2009

Scott Q&A: How to Customize Rails to_json output?

Rails has a bunch of JavaScript helpers, but once you move beyond those and want to write your own JavaScript code for your application, you may find yourself dealing with some JSON produced on the server-side.

By default, the to_json method in Rails is probably a lot more verbose than most people want. I’ll share a few tips on how to tame it.

Question: How can I slim down the output of to_json in Rails?

Continue Reading…

Scott JavaScript Variables and Anonymous Objects

JavaScript is not Ruby, but it does offer syntax that can lead to expressive code. There’s one case where JavaScript could have gone a step further and given us even more expressive code syntax, when dealing with object literals or anonymous objects.

Continue Reading…

3DM Design is where Scott Drake publishes thoughts on programming web applications in JavaScript and Ruby.