ruby on rails f.select options with custom attributes

后端 未结 5 1612
一个人的身影
一个人的身影 2020-11-28 01:34

I have a form select statement, like this:

= f.select :country_id, @countries.map{ |c| [c.name, c.id] }

Which results in this code:

5条回答
  •  遥遥无期
    2020-11-28 01:52

    I ran into this issue as well and created the "enhanced_select" Ruby Gem to solve this problem. You can find it here:

    https://github.com/bkuhlmann/enhanced_select

提交回复
热议问题