16 RJS Resources and Tutorials for Rails Programmers
New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.
A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.
Please note that this post is over four years old - it's from 2006! As such, these tips were relevant to Rails 1.2 and this content is woefully out of date. We will be updating it for Rails 3 soon! For now, head to the Ruby Inside homepage to find something else to read or check out the Ruby on Rails 3 Tutorial book and screencast which will bring you up to speed with all things Rails 3.
RJS is a template type for Rails that allows Rails developers to use Ruby to produce dynamic JavaScript code that will usually be executed in response to an AJAX call. There are lot of disparate resources relating to RJS around the net, so I've collected as many of them together here as possible. If you need to use RJS, this is the list for you!
Introduction / Tutorials
- Simple RJS Tutorial - An up to date RJS tutorial (May 2006) featuring a video demonstration and some code.
- RJS Tutorial by FearOfFish - Another overall tutorial with a demonstration view, controller, and RJS template for adding a shopping cart type system to a page.
- Real-world Rails RJS Templates - An introductory look at the benefits of RJS templates posted close to their introduction in December, 2005.
- Ajaxed forms with RJS templates - Technoweenie demonstrates how an entire form can be processed and manipulated using AJAX and RJS. Lots of nice syntax colored code!
- A Demo of RJS - A live demo of what RJS can do, including code.
- Redirection with RJS and AJAX - Showing some code to make a login process easier with RJS.
References
- Official RJS documentation from the Rails API docs - The official docs don't usually show the latest tricks, but it's great for the basics.
- RJS Template Methods - A list of methods supported by RJS templates from February 2006 (before Rails 1.1). It includes some demonstration code to put together a small app using RJS.
- RJS Templates, simplified - Another basic list of the RJS methods.
Miscellaneous / Advanced
- Add RJS support to TextMate - TextMate doesn't understand RJS by default, and this post shows you how to get the syntax coloring working.
- Another use for RJS templates - Advanced. A look at how to use the handy RJS methods from Prototype callbacks and static javascript files.
Debugging and Testing
- AjaxSpy - A cute way to debug and monitor RJS requests directly from the page. Only works in FireFox and Safari.
- Debugging your RJS calls - Find out what RJS is getting returned from the page end of things with this useful JavaScript trick.
- Tips for debugging RJS code - A list of useful tips and considerations when debugging RJS code.
- RJS Assertions Plugin - A plugin to help you with testing your RJS.
- RJS Assertions and Testing - Useful tips for testing RJS code and responses.
July 6, 2006 at 10:00 pm
Great list,
...second link does not work:
http://blog.fearoffish.com/articles/2006/03/04/tutorial-rails-rjs-templates
Pingback: my life