hello all!
I’m in deep shit for my exam tomorrow!
as you can see, I want to search with Tesi.search with all params
arriving from form ‘se’
so I need to add the @tmp result to @tesis collection if not empty…
If I use an array for @tesis I can push @tmp but then I got errors
in .rthml
If I use @tesis = Tesi.new I can’t push (I don’t know how to…)
but if I try to iterate @tmp in .rhtml it works…
PLEASEEEE HELLPPP!
my controller:
def dosearch
@search = “”
@tesis = Tesi.new
if (@params[“se”][“free”].to_s.length > 0)
@tmp = Tesi.search @params[“se”][“free”].to_s
@search << “” << @params[“se”][“free”].to_s << " in
Ricerca Libera "
if(@tmp)
@tesis << @tmp NOT WORKING
end
end
if (@params[“se”][“titolo”].to_s.length > 0)
@tmp = Tesi.search @params[“se”][“titolo”].to_s, :only =>
[‘titolo’]
@search << “” << @params[“se”][“titolo”].to_s << " nel
Titolo "
if(@tmp)
@tesis << @tmp NOT WORKING
end
end