On 2007-02-08 14:58:20 +0100, "Eivind Eklund" <eeklund / gmail.com> said: > On 2/8/07, Josselin <josselin / wanadoo.fr> wrote: >> as a new(ru)bie I always wonder when trying to DRY such code is good or >> not and why it should be (I don't like a lot the if.. else.. elsif... >> but sometimes it seems better for readiness... vs performances (less >> code..) >> >> If I should DRY it , any tip ? >> if params[:new_title].blank? >> params[:new_title] = nil >> elsif params[:new_title] == "null" >> params[:new_title] = "" >> end > > Seems to me like this should likely be an object, with > object.new_title being something like > > @title.blank? ? nil : (@title == "null" ? "" : @title) > > Though I also agree with Devin Mullins that the problem is likely to > be elsewhere (in overall structure). > > Eivind. Thanks to all .. getting clear