I have used this code, to collect the names by checking the condition in the model
<%= select_tag "name", options_for_select([["select" , "0" ]] + @names.collect{|p| [p.gatherName(p),p.id]}) %>
if condition fails value returns blank, in that case the otpions are ordered like this,
<option value='1'></option>
<option value='2'>lamrin</option>
<option value='3'></option>
while listing the box option 1 is balnk, option 2 has value, and option 3 is blank.
so please help me how to avoid the blank options in the collect
thanks
Try select or reject in addition to collect, e.g.
I also have to ask why gatherName takes a parameter that is the same as the object it is called on?
Edit: Doh, too slow I see.