(Rails) What is "RJS"?

Ethan picture Ethan · Jan 20, 2009 · Viewed 21.6k times · Source

I've seen "RJS" and "RJS templates" mentioned in passing in blog posts and tutorials. I did a search, but I'm still unsure about it. Is it a technology specific to Rails, rather than a standard like JSON or YAML?

I understand it's used for "generating JavaScript." Does it generate generic JS or Rails-specific JS requiring the Prototype and Scriptaculous libraries?

Answer

Rich Apodaca picture Rich Apodaca · Jan 20, 2009

This Railscast gives a nice example of using RJS to add and remove form fields dynamically without hitting the server with an ajax call.

These RJS tips may also be helpful.