select_tag() syntax

J

JZ

I cannot find out what type of variable shoud be used as option_tags in

select_tag(name, option_tags = nil, options = {}).

I used array, hash, nothing works. :(

<%=select_tag('test', option_tags=[1,2,3])%>
result:
<select id="test" name="test">123</select>

<%=select_tag('test', option_tags={'1'=>'one', '2'=>'two'})%>
result:
<select id="test" name="test">1one2two</select>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,170
Messages
2,570,921
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top