Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 select_tag() 助手,有没有办法避免将 id 传递给生成的元素?
如果没有,当您在一个页面上多次使用相同的表单并且想要保持 id 唯一时,您会怎么做?
啊,所以这是解决方案:
select_tag($name, $option_tags, array('id'=>'label_picker_for_' . $article_id);