ruby - Rails - two attributes one input field - Whats the Syntax? -
i need html output form
<input class="text valid" id="contacts_custom_field_phone_number_50754" name="contacts[custom_field][phone_number_50754]" size="30" type="text">
this got far
= f.label "phone" %br = f.text_field :custom_field=>{:phone_number_50754=>"123-213-2134"}
this wrong works in rails console , posts data api
how write code output need?
when in rails console
:custom_field=>{:phone_number_50754=>"123-123-2134"}
it posts api
you can use fields_for
:
- f.fields_for :custom_field |custom_fields| = custom_fields.text_field :phone_number_50754
Comments
Post a Comment