search for: animal_conditions

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

2006 Apr 22
4
Slice and dice plugin
...nd => {:conditions => {:name_contains => ''Tiger''}} do Animals.find :all end Finally, here''s an simple way to use this plugin to add lots of data slicing and dicing to any list actions you might have: class AnimalController < ActiveController def list animal_conditions = params.dup.reject! {|k, v| [:action, :control ler].include? k} @animals = Animal.find :all, :conditions => animal_conditions end end This allows urls such as /animal/list?name_starts_with=T&population_less_than=1000 Please take a look, the code is available at svn://rubyforge.org/v...