Assuming your model is derived from ActiveRecord::Base and named User , you can do with rails console
pp User.all # all users
or
pp User.all(:conditions => {:firstname => 'fred'}) # use hash conditions
or
pp User.all(:conditions => "lastname LIKE 'jenkin%'") # use custom sql conditions
and having the right user (say id 42) you can do
User.delete(42)
This pp means pretty printed. Another sometimes convenient is y , which prints material in Yaml format.
Edvardm
source share