Nineteen Rails Secrets To Web Development
Ruby on Rails has increased in popularity among web developers seeking a solid framework for their applications, and some helpful hints can make it even better.
A number of resources for the Ruby on Rails framework have arrived online since its debut. The Ruby Inside blog, maintained by English web developer Peter Cooper since May 29th of this year, offers some nice insights into Rails and the underlying Ruby object-oriented language.
His latest post comes in a format most people always enjoy finding online – the list. Cooper’s list of “19 Rails Tricks Most Rails Coders Don’t Know” suits that very well.
One Cooper noted, the acts_as_nested_set, made its quiet debut in Rails:
A couple of conversion tricks, like using the array method to_sentence, or the number helpers, have their place. An array of related terms like names can be rendered as a sentence. For numbers, helpers offer nifty shortcuts like formatting a number in currency format, or setting delimiters for them.
One useful speed trick can be accomplished for an application that has unchanging data from restart to restart, Cooper wrote:
Cooper also touched on a small framework, BackgrounDRb, that will be recognizable for its utility. This daemon allows the Rails application to send it tasks, and the daemon will complete them in the background.
“It’s extremely powerful, and useful for many tasks such as sending hundreds of e-mails, fetching URLs, and other things you don’t want to slow down the request times for your main app,” said Cooper.
Be sure to check out the rest of Cooper’s list for more excellent insights into working with Rails more effectively.
David Utter is a staff writer for WebProNews covering technology and business.