Select or select_tag?

hello PPL,

I’ve seen now that the _form.rhtml generated by script/scaffold is
populated by

<%= text_field ‘model’, ‘field’ %> without _tag!

but only text_field_tag is to be found in the 1.1.2 documentation…
(like in the rest of Module ActionView::Helpers::FormTagHelper there
is _tag)

I’ve tried to use <%= select instead of <% select_tag and it works
AND the first one generates:

and the other

my class can be saved just using the first one. but now I’ve problem
with the ‘option prameter’ :<

I’m a bit confused :slight_smile:


Emanuele T.
mob +39 329 29 56 995
icq 30 77 52 76
web mekdigital.com

found out that (what a pain!)

 @relatori = Relatore.find(:all)
 @relatori_select = Array.new
 for relatore in @relatori
 	@relatori_select.push([relatore.nome << " " <<

relatore.cognome, relatore.id.to_s])
end

this is ok for <%= select ‘tesi’,‘relatore_id’, @relatori_select %>

AND

 @correlatori = Correlatore.find(:all)
 @correlatori_select = "<option value=0> - nessuno - </option>"
 for correlatore in @correlatori
 	@correlatori_select << "<option value=" << correlatore.id.to_s

<< “>” << correlatore.nome << " " << correlatore.cognome << “”
end

works for <%= select_tag “tesi_correlatore_id”, @correlatori_select %>

mHisterycal LOL

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs