刘华佼的全栈学习记录

如何将表单换成Bootstrap提供的样式

| Comments

目标:

将表单换成Bootstrap提供的样式

步骤:修改共用表单_form.html.erb

<%= form_for @group do |f| %>

<div class="form-group">
    <div class="form-group string optional">
        <%= f.label "title", :class => "string optional control-label" %>
        <%= f.text_field :title, :class => "string optional form-control" %>
    </div>

    <div class="form-group string optional">
        <%= f.label "description", :class => "string optional control-label" %>
        <%= f.text_area :description, :class => "string optional form-control" %>
    </div>

</div>
<%= f.submit "Submit", class: "btn btn-primary", data: { disable_with: "Submitting..." } %>
<% end %>

Comments

comments powered by Disqus