module ActiveRecord
class Base
def self.to_select(conditions = nil)
find(:all).collect { |x| [x.name,x.id] }
end
end
end
class Array
def to_select
self.collect { |x| [x.name,x.id] }
end
end
<%= form_for 'monkey', @monkey do |f| %>
<%= f.select 'user_id', User.to_select %>
<% end %>
Firefox doesn't display a popup for the alt attribute for images. While this is according to spec, it's slightly annoying to put the same text in both the alt and the title. Put the following in your ApplicationHelper to copy the alt to the title for every image. Please don't tell me how wrong this is. I don't care.
module ApplicationHelper
def image_tag(location, options)
options[:title] = options[:alt] if options[:alt]
super(location, options)
end
end