ruby中html.haml文件的Tab键顺序/ tabindex设置

时间:2013-03-26 07:41:37

标签: ruby-on-rails haml tabindex tab-ordering

我已尝试tabindex => '1'tabindex = '1',但我无法获得标签索引/标签顺序。我希望从:full_name转到:telephone再到:address(这是排序错误的列)。有任何想法吗?提前致谢。这是我的代码。

=simple_form_for( :application, :url => users_path( application ), :method => :put ) do | f |
  .clearfix
    .column
      =f.input :full_name, label: 'Full Name', placeholder: 'Full Name'
      .help-block * please enter your legal name
      =f.input :address_1, label: 'Address', placeholder: 'Apartment, Street'
      .guardian
        =f.input :guardian_full_name, label: 'Guardian Full Name', placeholder: 'Full Name'
    .column
      =f.input :telephone, label: 'Telephone Number', as: :string
      .help-block  
      =f.input :address_2, label: ' ', placeholder: 'City, Country, Zip/Postcode'
      .control-group.boolean  
      .guardian
        =f.input :guardian_email, label: 'Guardian Email Address', placeholder: 'Email Address', as: :string
    .column#partner-details-errors
      =render 'partner_details_errors', application: application
  =f.submit 'Show Contract', class: 'btn btn-primary', data: { 'text' => 'Create Contract', 'disabled-text' => 'Creating ...' } 

1 个答案:

答案 0 :(得分:0)

使用input_html选项:

=f.input :full_name, label: 'Full Name', placeholder: 'Full Name', input_html: { tabindex: 1 }