我在我的Rails应用程序中使用simple_form,我试图将form-horizontal类添加到我的表单中.
<form accept-charset="UTF-8" action="/account/orders" class="simple_form new_order" data-validate="true" enctype="multipart/form-data" id="new_order" method="post" novalidate="novalidate">
当我使用html:{class:“form-horizontal”}时,将class =“simple_form new_order”更改为class =“simple_form form-horizontal”.
我应该怎么做来保持new_order类?
解决方法
这是行为 –
https://github.com/plataformatec/simple_form/commit/1e8bba7eb378da86cabb3d6a0ece9b34998c58e2
所以如果你想改变它,你应该在 https://github.com/plataformatec/simple_form/blob/master/lib/simple_form/action_view_extensions/form_helper.rb这个文件中的monkey-patch simple_form_css_class方法.
所以如果你想改变它,你应该在 https://github.com/plataformatec/simple_form/blob/master/lib/simple_form/action_view_extensions/form_helper.rb这个文件中的monkey-patch simple_form_css_class方法.