这是我试过的,simple_form_for调用忽略了我的类设置。
# Rails code in view: <%= simple_form_for @admin_artist,:class => 'foobarbaz' do |f| %> # Renders: <form accept-charset="UTF-8" action="/admin/artists" class="simple_form new_admin_artist" id="new_admin_artist" method="post" novalidate="novalidate">
有什么建议么?
解决方法
这将工作
<%= simple_form_for @admin_artist,:html=> { class: 'foobarbaz' } do |f| %>