渲染表单中的参数未传递给数据库

时间:2017-11-08 09:53:19

标签: ruby-on-rails

                                                                                             
    <div class="row" style="padding-bottom: 25px">
      <div class="col-md-2"></div>
      <div class="col-md-4">
        <%= f.label :delivery_rate %>
      </div>
      <div class="col-md-4">
        <%= f.text_field(:delivery_rate, {placeholder: 'Rs. 0.00', class: 'form-control input_border input_field_text_align_right'})%>
      </div>

    </div>

这是渲染的形式部分 并且此部分数据应传递到prd_allisland_flat_deliveries

在控制器中我写了这个参数

def item_params                                         
  params.require(:prd_item).permit(:item_name, :brand, :item_no, :short_description, :long_description, :prd_type_id, :usr_vendor_property_id, :price,:base_price, :price_discount, :percentage_discount, :stock_count, :availability, :tags, :remove_image, :delivery_type , :min_stock_count, prd_item_images_attributes: [:id, :image, :description, :link, :_destroy ],
  prd_temp_variation_stores_attributes: [:id, :product_variations, :variation_items, :_destroy],
  prd_temp_compound_stores_attributes:[:id,:compound, :compound_item, :_destroy],
  prd_temp_spec_stores_attributes:[:id,:compound, :compound_item, :_destroy],
  prd_allisland_flat_deliveries_attributes: [:id,:delivery_period,:delivery_rate])
end

prd_allisland_flat_deliveries表的值不会使用值

更新

任何人都可以帮忙吗?

0 个答案:

没有答案