Rails f.date_select html_options no effec

时间:2015-06-29 10:14:51

标签: ruby-on-rails ruby ruby-on-rails-4

我想在Rails 4.2.1中的date_selects中添加一个自定义css类

但是html_options标签没有效果。

代码如下所示:

<%= raw t("settings.pause", :pause_starts_on => f.date_select(:pause_starts_on, :include_blank => true, :order => [:month, :day, :year], :start_year => Time.now.year, :html_options => {:class => "form-control"}).force_encoding("UTF-8"),
                    :pause_ends_on => f.date_select(:pause_ends_on, :include_blank => true, :order => [:month, :day, :year], :start_year => Time.now.year, :html_options => {:class => "form-control"}).force_encoding("UTF-8"))
          %>

1 个答案:

答案 0 :(得分:0)

在没有:html => {:class => "form-control"}

的情况下尝试_options