Skip to Content
Ruby on Rails® for Microsoft Developers
book

Ruby on Rails® for Microsoft Developers

by Antonio Cangiano
April 2009
Intermediate to advanced content levelIntermediate to advanced
479 pages
12h 55m
English
Wrox
Content preview from Ruby on Rails® for Microsoft Developers

9.6. Alternatives

Rails is opinionated software, and as such ships with a set of sensible defaults. As you have seen throughout this chapter, Rails assumes that you'll be using ERb, Builder, and RJS templates, and that you're going to employ Prototype and script.aculo.us. But it's important to understand that you are not limited to these options. Should you prefer a different template engine, you are free to adopt one instead of ERb. Common choices are Haml (http://haml.hamptoncatlin.com) and Liquid (http://www.liquidmarkup.org). If you'd like to simplify writing CSS, you can also check Haml's sister project, Saas.

Regarding Ajax, more than 200 frameworks are out there. Prototype is one of the best and most popular, but should you feel inclined to work with a different framework, you can copy it over in public\javascripts, include it with javascript_include_tag, and then it will be ready for you to use whenever you like. Of course, you'd be using JavaScript, as opposed to comfortable Ruby wrappers, but you can always define your own Ruby helpers and perhaps share and distribute them with others as a plugin. In fact, many plugins for alternative JavaScript libraries exist or are under development at the moment.

One JavaScript library in particular has been gaining a lot of momentum: jQuery. It's very light, fast, powerful, and well written, and it's been able to catch the interest of many Rails developers. If you are among the legions of jQuery fans, you should use the jRails plugin ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ruby on Rails™ 3 Tutorial: Learn Rails™ by Example

Ruby on Rails™ 3 Tutorial: Learn Rails™ by Example

Michael Hartl

Publisher Resources

ISBN: 9780470374955Purchase book