请告诉我应该如何修复此选项/选择菜单。我糟糕的语法必须阻止:class =>"sign-pay-lm1"
被应用。
<span class="signup-label-paying">
<%= select "payments", "expiry_month", User::MONTH_NAMES.collect{|x| [x, User::MONTH_NAMES.index(x) + 1] }, :class =>"sign-pay-lm1" %>
</span>
答案 0 :(得分:2)
尝试:
<span class="signup-label-paying"><%= select "payments", "expiry_month", User::MONTH_NAMES.collect{|x| [x, User::MONTH_NAMES.index(x) + 1] }, {}, { :class =>"sign-pay-lm1"} %>
确实html_options
是最后一个哈希。 See doc