25

这是我尝试过的,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">

有什么建议么?

4

2 回答 2

47

这会工作

<%= simple_form_for @admin_artist, :html=> { class: 'foobarbaz' } do |f| %>
于 2013-06-08T04:18:01.977 回答
0

你应该:html这样使用:

<%= simple_form_for @admin_artist, :html => { role: 'form', class: 'foobarbaz' } do |f| %>
于 2015-07-17T08:29:19.267 回答