这是以下苗条 simple_form 表单的屏幕截图。这显示正确。但这给了我类型 nil 错误。
= simple_form_for :identity, :url => '/auth/identity/register' do |f|
h2 Create New Account
.form-actions
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
input type="text", label:false, :class => "inline"
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
input type="text" id="" name="" f:email
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
input type="text" id="" name="" f:password
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
input type="text" id="" name="" f:password_confirmation
.control-group
.controls
= f.button :submit, :class => 'btn-primary'
这是以下代码的屏幕截图。这很好用(不给出 nil 类型错误。因为它需要模型字段。)但是外观被打破了。
= simple_form_for :identity, :url => '/auth/identity/register' do |f|
h2 Create New Account
.form-actions
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
=f.input :name, label:false
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
= f.input :email, label:false
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
= f.input :password, label:false
.control-group
.controls
.input-prepend
span.add-on
i.icon-user
= f.input :password_confirmation, label:false
.control-group
.controls
= f.button :submit, :class => 'btn-primary'