Hi,
i ve got this piece of code : <%= select("profile", "vlogiciel", @vlogiciel.collect {|vlogiciel| [ vlogiciel.logiciel.nom, vlogiciel.id ] }, :include_blank=>true, :selected=>(@vl).to_i )%>
But i would like to do that
<%= select("profile", "vlogiciel", @vlogiciel.collect {|vlogiciel| [ vlogiciel.logiciel.nom + vlogiciel.lversion.nom, vlogiciel.id ] }, :include_blank=>true, :selected=>(@vl).to_i )%>
But sometime vlogiciel.lversion is NULL, so i need to add an unless condition like that :
<%= select("profile", "vlogiciel", @vlogiciel.collect {|vlogiciel| [ vlogiciel.logiciel.nom + unless vlogiciel.lversion == nil vlogiciel.lversion.nom end, vlogiciel.id ] }, :include_blank=>true, :selected=>(@vl).to_i )%>
There is synthax error so it s not working. i can t figure out how to add a conditions into this select...
Does anyone have an idea ?
Thanks Guillaume.