Rails Views, Rails Recipes Selections
These are in no particular order, and certainly aren’t the only recipes that I’d recommend– just the ones that immediately jump out at me as I flick through my copy.
Recipe 52: Making Your Own Rails Plugins
Plugins aren’t just for monkey patches and portable “drop in” functionality. You can toss views into plugins as well to make your app even more modular– or provide a common interface across different applications. This recipe gives you a kick start on putting together your first plugin. Plugins, people, are a mandatory skill.
Tip: I usually create a files/ subdirectory inside plugins, throw my views in there, and use my good friend, render :file with a relative path to take care of business.
Recipe 44: Write Tests for your Helpers
Now helpers can have all the stable goodness that TDD can help make possible; this recipe helps you set-up a test environment for testing these little beasties… something that, sadly, isn’t as cut-and-dry as we’d like.
Recipe 12: Creating a Custom Form Builder
This is really neat stuff. As I’ve mentioned before, form_for is the wave of the future, and FormBuilder is along for the ride. In this recipe Chad goes over how to build form builders, and highlights how useful they can be.
We use a little form builder, form_table, extensively in our application at work– both in and out of form_for. I can’t even guess at the amount of time it’s saved us– but it’s a lot!
Recipe 61: Adding Support for Localization
If you’re creating an interface that will have to support multiple languages, the Globalize Plugin just fits the bill. In this recipe, the extremely eloquent, good-looking author gives a brief overview of how to use this pivotal plugin.
Okay, I admit it– I wrote this one. It’s still really good, I promise.
Recipe 6: Update Multiple Requests with One Ajax Request
This recipe introduces you to the idea of using RJS is your responses; if you’re still using :update on your linktoremotes (or other such tomfoolery) you’ll want to give this a look.
Recipe 39: Write Code that Writes Code
In my opinion, this is one of the best recipes in the book, introducing important metaprogramming tools like define_method. Metaprogramming is the staple of the truly advanced Rails programmer– who is, framework knowledge aside, also an advanced Ruby programmer.
If you take the knowledge you pick up in this recipe, and apply it liberally across controllers, models, and helpers (in and out of plugins), can’t your application really become a language?
So..
If you know what’s good for you (and your skills), buy this book. If you’re a sucker for instant gratification, pick up a PDF copy, too (it’s great for searching).
Today my copy of Rails Recipes arrived, fresh from the press. Things have been pretty busy for Dave Thomas these last few days, getting the preorders out the door.
If you’re the type of developer that puts the ‘V’ in ‘MVC’ and are looking for a little direction, some examples of best practices, or just some really good ideas to help make you a better Rails developer, I’d recommend you add this book to your library.
There’s a few recipes from the book I especially think you should check out if you’re into views, and here they are…
- Person:
- Programming Language:
- Tags:
- Technology:


Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago