/ Published in: Other
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
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
Comments
 Subscribe to comments
                    Subscribe to comments
                
                