现在我正在通过表单传递模型(building_approval)参数。
Processing by BuildingApprovalsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"FdZWpexusIHZ/3p04Vg1Pn8YxCrp1I8v06j68lI/PoTFeKKGKrc5upcQdaK6UENl0CBINcymgUlylSC8AW2RfA==", "building_approval"=>{"urgency"=>"urgent", "title"=>"title1", "member_id"=>"-1", "deal_bu\
ilding_id"=>"1", "building_name"=>"social 309", "building_id"=>"1", "fixed_price"=>"25000000", "sell_price"=>"50000000", "lowest_sell_price"=>"20000000", "loan_amount"=>"5000000", "deposit"=>"5300000", "disc\
ount_amount"=>"-25000000", "contract_date"=>"2019/03/26", "commission_type"=>"rent_offset", "commission_amount"=>"50000", "management_type"=>"loan", "room_support"=>"joined", "building_rank"=>"1", "memo"=>"", "comment"=>"", "customer_i\
d"=>"6", "approvals_attributes"=>{"0"=>{"member_id"=>"1", "approval_status"=>"pending", "tag_id"=>"56", "id"=>"1"}, "1"=>{"member_id"=>"20", "approval_status"=>"pending", "tag_id"=>"55", "id"=>"2"}}}, "commit"=>"save", "prospective\
_customer_id"=>"6", "id"=>"1"}
我想在模型param(build_approval),authenticity_token和utf8旁边传递一个名为“ reapply”的参数。最优雅的方法是什么?
答案 0 :(得分:0)
您可以传递一个隐藏参数,该参数将在提交表单时发送,但不会被用户看到。
将此添加到您的表单
<%= hidden_field_tag(:reapply, @value) %>
其中的值可以在控制器中声明,或者如果它是常量,则可以直接在隐藏字段标签中声明。