Favorite code shortcuts?

I was wondering what everyones favorite code shortcuts is?

i recently, thanks to this forum, came accross the power of constatize
and humanize. that alone cut down my long case statements that i was
writing in creating and building my instance variables to and from

for example i used to have this

def getcat(category)

case category
when “cat1”
@myobj = Cat1.new
when “cat2”
@myobj = Cat2.new


now i can just do this right? this can handle all my case statements now


also i like combining my if statements like

if @myobj.save and category == ‘somehting’ then
do what ever
go to error paritial…works great when using validates