发送的表单不完整。有些地方就在附近

时间:2011-06-07 18:12:52

标签: ruby-on-rails ruby-on-rails-3 html-form

当我发送新表格时,某些字段不会放在最终地图中 - 它们就在附近。不知道为什么会这样......

查看 - 发送

<%= form_for :review, :url => { :action => "show" } do |f| %>
  <div class="field">
    <%= f.label :owner %><br />
    <%= f.text_field :owner %>
  </div>
  <div class="field">
    <%= f.label :special %><br />
    <%= f.check_box :special %>
  </div>  
  <div class="field">
    <%= f.label :overview %><br />
    <%= text_area_tag(:overview, "", :size => "24x6") %>
  </div>
  <div class="field">
    <%= label_tag(:service_overview, "overview") %>
    <%= radio_button_tag(:service, "overview") %>
    <%= label_tag(:service_repair, "repair") %>
    <%= radio_button_tag(:service, "repair") %>
  </div>

  <div class="actions">
    <%= f.submit "Next" %>
  </div>
<% end %>

移植

create_table :reviews do |t|
  t.string :owner
  t.string :service
  t.string :overview
  t.boolean :special
  t.integer :cost
  t.timestamps
end 

编辑 - 当然还有: 服务器日志

  Parameters: {"commit"=>"Next", "overview"=>"123123", "service"=>"repair", "re
view"=>{"special"=>"1", "owner"=>"aaaa"}, "authenticity_token"=>"HehoAEoQRvLwFL9
yZsbBXzy4PI9a53JjtfM4rqtMUt8=", "utf8"=>"Ôťô"}

好的,我知道,在HTML中,发送的地图中包含的标签与这些标签之间存在差异,而不是:

  <input id="review_special" name="review[special]" type="checkbox" value="1">
  <input id="service_overview" name="service" type="radio" value="overview">

但仍然不知道如何修复它......

0 个答案:

没有答案