def is_translated?
    if !params[:lang].blank? and params[:lang].eq?('en')
      return true
...

Ruby too many ifs and ands

by corroded, August 09, 2010 10:25, 5 refactorings, tagged with rails ruby

there are too many if then ...

A53cdbd5cbc6e9fc944d35331a32e63c Talk
def download
    dl_opts = params[:dl].nil? ?   'attachment' : 'inline'
    dl_img  = params[:type].nil? ? "" : "_#{params[:type]}"
...

Ruby Download file

by teamco-anthill.blogspot.com, March 15, 2009 12:50, No refactoring, tagged with rails ruby

Try to refactor send file code

2ddbd54c304df255bdb709f2cd50ffe8 Talk