0

是否有一个 twitter 引导类可以在表单提交按钮的底部显示所有验证错误消息?

<div class="row-fluid">
<div class="span12"> 
    <div class="devise-body">

<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name),
      :html => { :class=>'control-group error'} ) do |f| %>
      <%= f.error_notification %>
      <div class="controls">
        <div class="row-fluid">
            <div class="span6">
            <%= f.input :first_name,:required=>true,:autofocus => true %>
                            </div>
            <div class="span6"><%= f.input :last_name,:required=>true%>  
         </div>
        </div>
        <div class="row-fluid">
            <div class="span6"><%= f.input :company %></div>
            <div class="span6"><%= f.input :title %></div>
        </div>

        <div class="row-fluid">
            <div class="span6"> <%= f.input :email, :required => true %></div>
            <div class="span6"><%= f.input :phone_number %></div>
        </div>  


        <%= f.input :password, :required => true %>
        <%= f.input :password_confirmation, :required => true %>
      </div>
      <div class="form-actions" > 
        <!-- #class="form-actions" -->
        <%= f.button :submit, "Sign up" ,:class => 'btn'%>
      </div>
    <% end %>
    <%= render "devise/shared/links" %>
   </div>

</div>

4

1 回答 1

1

如果我是你,我会使用他们的警报类:

http://twitter.github.com/bootstrap/components.html#alerts

于 2012-11-07T17:43:58.567 回答