RJS Templates for Rails
By Cody Fauser
June 2006
Series: Short Cut
Format: PDF
ISBN: 0-596-52809-4
Pages: 56
Description:
RJS templates are an exciting and powerful new type of template added to Rails 1.1. Unlike conventional Rails templates that generate HTML or XML, RJS templates generate JavaScript code that is executed when it is returned to the browser. This JavaScript generation allows you to perform multiple page updates in-place without a page reload using Ajax. All the JavaScript you need is generated from simple templates written in Ruby. This document helps you get acquainted with how RJS templates fit into the Rails framework and gets you started with a few easy-to-follow examples.
Everything is true in the description above. The book “RJS Templates for Rails” is one way to fill the void of good books on RJS, maybe the only excellent book. It is a first-class way to improve RJS experience of developers from beginners to experts in a hurry. Even experts should consider the price a steal if their collection on Rails 1.1 and RJS Templates is to be thorough.
I really like the gray boxes with encouragement to remember to use or not use things like: “Don’t use the :update Option with RJS Calls” [page 6]. A number of the learning issues are explained in a series of fine examples, most just a few lines of code. I think it is important to develop code in general using the same thought processes the author uses.
I liked the simple application developed during the book right away: My Thoughts. It should be a helpful and useful starting point for others to develop what they need or want with RJS Templates and Rails 1.1. Another application is an expense tracker.
My experience agreed with almost everything written. I am a member of a user group that has had numerous lectures on Rails in the last year. Most members are developers and deal with trying to create applications with less than adequate documentation. I appreciate the short and sweet code and explanations in this book.
“The Principle of Least Surprise” is interesting. Find it on page 11 if you have not run into this before.
The topics start with an introduction, then Getting Started with a Simple Example, the RJS and Rails, the RJS in Practice, Firebug, Enhancing the Expense Tracker, RJS Reference and an Appendix.
The 56+ pages are clearly written. I like that about this book. No long winded explanations of useless trivia here. Get right to the point and stay there. The code is clear and helps understanding the issues presented by the authors.
The Firebug utility developed by Joe Hewitt is an interesting tool for debugging with a good explanation by the author. This is valuable knowledge worth your time to read and digest as thoroughly as possible.
The book is in .PDF format. I like that feature. You can buy this online through the O’Reilly shopping cart and then download it.
The 56+ pages were easy to read and understand. I read it in one evening. There were a few typos and grammar errors, but not very many. The book is for someone who is a little more than a beginner. More experienced people should look it over to make sure they are up to speed with these authors.
I would give this book 5 out of 5 stars. Since it is such a quick and easy read, you might be missing something unless you check your knowledge against these experts.
Frederick J Eccher Jr November 25, 2006
MBA
M.S. Management of Information Systems
A.B. Psychology
B.A. Biology
President, Board of Directors, Saint Louis Visual Basic Users Group
rick@stlvbug.net
|