开发者

Sent form isn't complete. Some fields are near by

开发者 https://www.devze.com 2023-03-11 06:31 出处:网络
When I am sending new form, some fields aren\'t put in final map - they are just near by. Have no idea why is it happening...

When I am sending new form, some fields aren't put in final map - they are just near by. Have no idea why is it happening...

View - sending

<%= 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 %>

Migration

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

edit - and of course: Server log

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

Ok, I see, that in HTML there is difference between tags which are included in sent map and these, which aren't:

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

but still no idea how to fix it...

0

精彩评论

暂无评论...
验证码 换一张
取 消