tried to create simple dropdown in ruby - like that :
<%= select_tag(:origin_id, '<option value="1">Lisbon</option>') %>
and I received an empy one.
this is the generated html
<select id="origin_id" name="origin_id"><option alue="1">Lisbon</option>/select>
将您的HTML标记为安全,以避免Rails对其进行转义。
<%= select_tag(:origin_id, '<option value="1">Lisbon</option>'.html_safe) %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.