ActiveJax ========== ### Overview ### Give direct access to ActiveRecord object attributes in javascipt. ### Requirements ### prototype 1.5+ rails 1.2+ ### How it works ### add the line active_jax to your models and that's it. Ok, not really, but pretty close. Here is a model to show you how it works. class Cat < ActiveRecord::Base # columns # id # name # registration_number active_jax end By default active_jax makes available all find* methods you define plus, find and find_all from ActiveRecord::Base Then in your java script you can write: ActiveJax.Cat.find_all().each(function(cat){ . . . }); That will call the server get all the cats and call the function passed into each one time per cat. That is the basics, you can replace each with all, then it will only be called once with all the cats. ### What about security ### People tend to get nervous when you allow more access to the database. That is why this plugin is optin, you have to include the line active_jax in each class you want made available to javascript. In addition to the opt in you have the ability to exclude columns from the data that gets returned to javascript. You can do that by replacing the active_jax line in the previous example with: active_jax :exclude_columns => [:registration_number] Now only the name and id will be passed into the js.