0
我遵循API说明,但表单行为不会输出它在示例和示例源代码中应该说的内容。为什么不用bootstrap生成引导程序兼容的表单?
我安装了simpleform和bootstrap。 我做了rails g simple_form:install --bootstrap 我看到这些文件已经生成。
Simpleform说要为元素做代码像这样
= simple_form_for @park, html: { multipart: true, role: "form", class: "form-horizontal" } do |f|
- if @park.errors.any?
#error_explanation
%h2= "#{pluralize(@park.errors.count, "error")} prohibited this park from being saved:"
%ul
- @park.errors.full_messages.each do |msg|
%li= msg
= f.input :address, label: 'address', autofocus: true, placeholder: "123 Fake Street Irvine, CA 90123", class: "form-control"
的形式简单的输出越来越那种可笑的DSL的层。
很多事情错的输出 1)包装类不举的form-group
匹配,而是它仍然controls
2)形式不伸出宽度为100%像它应该。 3)如果输入未被检测为“必需”,则标签不会被包裹,而是粘到屏幕的左侧。
API为什么不起作用?