Hi,
i was hoping someone could give me a little reffer to how i could do
this in a cleaner way (i’m implementing a search task) =>
def search_task
…
if params[:id]==306
@page_pages, @page = paginate(:pages,
:conditions => [‘a=? and b=? and c=? or d like ?’, var1, var2, var3,
var4] ##
:per_page…)
else
@page_pages, @page = paginate(:pages,
:conditions => [‘a=? and b=? or d like ?’, var1, var2, var4] ##
:per_page…)
end
…
end
i feel as if this is a complete waste of line-code, and was hoping there
was some cleaner way to write this (not needing to copy the whole thing,
becuase of one var excluded, or two, etc)
many thanks!
harp