search for: constantsmodel

Displaying 1 result from an estimated 1 matches for "constantsmodel".

2006 Feb 17
4
Table with Constants
...| M | Male | sex .... I know it can be done like this <% select ''object'', ''method'', Constants.find(:all, :select => ["key, value"], :conditions => [''type = ?'', "sex"]) %> I prefer to have something in the ConstantsModel to return an array like class Constants < ActiveRecord::Base def find_by_type (type) find(:all, :select => ["key, value"], :conditions => [''type = ?'', type]) end end Can anyone help me? -- Posted via http://www.ruby-forum.com/.