阅读背景:

如何在bootstrap模式中获取保存按钮以提交表单

来源:互联网 

I have a form like so:

我有一个这样的表格:

.row-fluid
  = form_for(@client) do |f|
    - if @client.errors.any?
      #error_explanation
        %h2
          = pluralize(@client.errors.count, "error")
          prohibited this client from being saved:
        %ul
          - @client.errors.full_messages.each do |msg|
            %li= msg
    .fieldset
      %legend
        = @header
      .control-group
        %label.control-label
          Name
        .controls
          = f.text_field :name, :class => "input-xlarge"
      .control-group
        %label.control-label
          Street Address
        .controls
          = f.text_field :street, :class => "input-xlarge"
      .control-group
        %label.control-label
          Unit
        .controls
          = f.text_field :unit, :class => "input-small", :placeholder => "optional"
      .control-group
        %label.control-label
          City
        .controls
          = f.text_field :city, :class => "input-xlarge"
      .control-group
        %label.control-label
          State
        .controls
          = f.text_field :state, :class => "input-small"
      .control-group
        %label.control-label
          Zip
        .controls
          = f.text_field :zip, :class => "input-small"
    .form-actions
      = f.submit "Save", :class => "btn btn-primary"
      .btn
        = link_to "Cancel", :root, :style => "color: #333; text-decoration: none;"
.row-flui



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: