Ruby-on-Rails

HAML: A new view template language for Rails

HAML is a new template language for Ruby on Rails developed by Hampton Catlin, a Canadian Rails developer. It's a high-level, heavily semantic language that breaks the mold of RHTML and makes it very hard to make markup errors. In a way similar to Python, HAML relies on indentation, which it uses to enforce DOM hierarchy.

Read more →

Flexible Rails: PDF book looking at Rails 1.1 + Adobe Flex 2

Peter Armstrong has just released the initial version of his PDF-only book, Flexible Rails. It's available for $20, and anyone who buys the book now will get free PDF copies of every subsequent version of the first edition of the book. You can also order the book in 5 copy, 10 copy, and 30 copy editions for use in the workplace.

Read more →

Find Old / Deprecated Code in your Rails Apps with a Plugin

On the back of Kevin Clark's "Things You Shouldn't Be Doing in Rails", Geoffrey Grosenbach has created a plugin called 'deprecated' that, with a single rake task, will alert you to all of the old and deprecated code in your application. This is perfect for bringing those old applications up to date and will help you catch all of the changes necessary, such as using flash and session instead of @flash and @session, etc.

Read more →

acts_as_textiled: Auto-formatted columns plugin for Rails

>> story.description = "Peter flippin' _Cooper_"
=> "Peter flippin' _Cooper_" 

>> story.description
=> "<p>Peter flippin&#8217; <em>Cooper</em></p>" 

>> story.textiled = false
=> false

>> story.description
=> "Peter flippin' _Cooper_"

Chris Wanstrath has created acts_as_textiled, a new plugin for Rails that allows you to specify columns on your model to be automatically parsed as Textile content.

Read more →

Speed up your Rails database requests with memcached

Geoffrey Grosenbach looks at how to use memcached, a fast in-memory caching daemon, from Ruby and Rails to speed up common repeated data operations, including ActiveRecord lookups. He also includes a useful install script and patch for Mac OS X users to make memcached fly on that platform. He also demonstrates the use of the cached_model gem to significantly speed up database reads from Rails applications.

Read more →

Queue ActionMailer e-mails with ar_mailer

ar_mailer is a system that automatically queues outgoing mails from Rails applications (using ActionMailer) by placing them into a special database table, to then be handled by a separate process, ar_sendmail. This could be particularly ideal for systems with mass mailing applications or simply as a method to speed up certain requests in your Rails applications since only a single database write is required rather than waiting for an e-mail to finish sending.

Read more →

Testing Rails: A blog (and book!) about testing and debugging Ruby on Rails

Evan Henshaw-Plath (more commonly known as rabble) is in the process of writing a book for O'Reilly about testing and debugging Ruby on Rails applications, and has just launched a companion blog, Testing Rails. The subject of the blog is exactly what the title says, and rabble hopes to post at least one in-depth tutorial relating to Rails and testing each week. The first is Building Tests from Logs - Test Driven Debugging.

Read more →

acts_as_most_popular: Data popularity extension for Rails models

Aamp

Shane Vitarana, creator of Rails Stats, has released a new plugin, acts_as_most_popular. acts_as_most_popular adds a method for each column in your model's table called most_popular_* that returns an array of the most popular entries within that column. For example, if you have 1000s of users in your user table, User.most_popular_names would return an array with the most popular names, as found in the name column.
Learn more here. This seems like the sort of thing that might eventually be useful as a Calculation of some kind.

Read more →