我一直在尝试将我的“记住我”复选框放在我的垂直表单中(使用 simple_form)
我得到了错误
ActionView::Template::Error (Couldn't find wrapper with name inline_checkbox):
config/initializers/simple_form_bootstrap.rb(我也试过把is放在simple_form.rb中)
config.wrappers :inline_checkbox, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
b.use :html5
b.use :placeholder
b.wrapper :tag => 'div', :class => 'controls' do |ba|
ba.wrapper :tag => 'label', :class => 'checkbox' do |bb|
bb.use :input
bb.use :label_text
end
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
end
newform.html.erb
<div class="row">
<div class="span4">
<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: "well"}) do |f| %>
<fieldset>
<legend>Log In</legend>
<%= f.input :email %>
<%= f.input :password %>
<% if devise_mapping.rememberable? -%>
<div ><%= f.input :remember_me, :wrapper => :inline_checkbox, as: :boolean %>
<% end -%></div>
<div><%= f.button :submit, "Log in" %></div>
</fieldset>
<% end %>
<%= render "devise/shared/links" %>
</div>
<div class="span8">
</br>
<h2>Logging in is easy and secure </h2>
</div>
</div>
我无法弄清楚为什么它没有找到我的 config.wrapper ...