S
S
Semen Frolov2020-11-15 18:14:51
Ruby on Rails
Semen Frolov, 2020-11-15 18:14:51

How to store select name="field[index] in jsonb in Rails?

Greetings, I can’t figure out how to do it.

There is a pack of elements

<select class="form-control " name="item[fields_mapping][1]" id="item_fields_mapping">
options....
</select>
<code lang="html">
<select class="form-control "  name="item[fields_mapping][2]" id="item_fields_mapping">
options....
</select>
<code lang="html">
<select class="form-control "  name="item[fields_mapping][3]" id="item_fields_mapping">
options....
</select>
</code>


база данных postgres, поле fields_mapping тип jsonb
не сохраняется json объект, сохраняется только значение первого элемента select

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question