to_javascript helper method for controllers
Merge pull request #1 from darkphnx/master

to_javascript helper method for controllers