collect on a select helper

<%= select( "bar", "account", Bar.find_by_sql( 'SELECT * From bars where   bars.account > 0' ).collect{ |p| [p.account, p.id] },   {include_blank => false } ) %>

Rails eliminates the need to degenerate your code to SQL fragments for most things.

You could write this query more cleanly. Instead of:

  Bar.find_by_sql( 'SELECT * From bars where bars.account_id > 0' )

Do this:

  Bar.find(:all, :conditions => 'account_id > 0')

Cheers, Ryan