Forms 为什么';带引导的简单表单是否生成与引导兼容的表单?
我遵循API说明,但是表单行为没有输出它在示例和示例源代码中所说的内容 我安装了simpleform和bootstrap。 我做了rails g simple_表单:安装--引导 我看到文件已经生成 Simpleform说为这样的元素编写代码Forms 为什么';带引导的简单表单是否生成与引导兼容的表单?,forms,twitter-bootstrap,simple-form,Forms,Twitter Bootstrap,Simple Form,我遵循API说明,但是表单行为没有输出它在示例和示例源代码中所说的内容 我安装了simpleform和bootstrap。 我做了rails g simple_表单:安装--引导 我看到文件已经生成 Simpleform说为这样的元素编写代码 = simple_form_for @park, html: { multipart: true, role: "form", class: "form-horizontal" } do |f| - if @park.errors.any? #
= 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) 包装类与引导的表单组
不匹配,相反,它仍然是控件
2) 表单没有像它应该的那样延伸100%的宽度。
3) 如果一个输入没有被检测为“必需”,标签就不会被包装,它会粘在屏幕的左侧
为什么API不工作?使用bootstrap的简单表单生成器命令为bootstrap 2.x生成配置初始值设定项文件 因此,您必须修改初始值设定项文件以生成适当的类 看看这个问题的答案