0
아이디어를 증명할 빠른 응용 프로그램을 만들기 위해 레일스를 배우고 있습니다. 나는이 뷰 코드에 자신의 길을 더듬었다. 제출 버튼이 <form>
태그 안에 없기 때문에 이해가됩니다. 양식을 제출할 수 없습니다. 이 문제를 어떻게 해결합니까?단일보기에서 여러 양식을 제출할 수 없습니다.
<div class="PR">
<%= simple_form_for @purchaserequest, html: {class: 'form-inline'}, defaults: { wrapper_html: { class: 'pr' }} do |f| %>
<%= f.input :requestor %>
<%= f.input :charge_number %>
<%= f.input :date_of_intended_use %>
<% end %>
<%= simple_form_for @purchaserequest, html: {class: 'form-inline'}, defaults: { wrapper_html: { class: 'pr' }} do |f| %>
<%= f.input :end_user %>
<%= f.input :shipping_method %>
<%= f.input :ship_to %>
<% end %>
<br><br>
</div>
<div class="pr_items_group">
<%= simple_form_for @purchaserequest, html: {class: 'form-inline items'}, defaults: { wrapper_html: { class: 'pr_items' }} do |pr_items| %>
<%= pr_items.nested_fields_for :item, defaults: { wrapper_html: { class: 'pr_items' }} do |f| %>
<%= f.input :critical %>
<%= f.input :tech_reqs %>
<%= f.input :description %>
<%= f.input :manufacturer %>
<%= f.input :item_number %>
<%= f.input :purchased_quantity, label: 'Quantity', input_html: { class: 'quantity', onkeyup: 'updatePrice()' } %>
<%= f.input :price, input_html: { class: 'price', onkeyup: 'updatePrice()' } %>
<%= f.input :notes %>
<%= f.remove_nested_fields_link 'Remove item', class: 'btn btn-primary' %>
<br><br>
<% end %>
<%= simple_form_for @purchaserequest, html: {class: 'form-horizontal'}, defaults: { wrapper_html: { class: 'pr' }} do |f| %>
<%= f.input :tax, :readonly => true , input_html: { id: 'tax' } %>
<%= f.input :shipping_total, input_html: { class: 'shipping_total', onkeyup: 'updatePrice()' } %>
<%= f.input :grand_total, :readonly => true , input_html: { id: 'grand_total' } %>
<% end %>
<br>
<p><%= pr_items.add_nested_fields_link :item, 'Add item', class: 'btn btn-primary' %> | <%= pr_items.button :submit, 'Create Purchase Request', class: 'btn btn-primary actions' %></p>
<% end %>
</div>`
나는 그것이 작동 확신 해요. 문제는 지금 내 CSS는 모두 다행이다. 감사! – Drise