Javascript 从“提交选项”;选择";标签

Javascript 从“提交选项”;选择";标签,javascript,ruby-on-rails,forms,Javascript,Ruby On Rails,Forms,我看到了一大堆类似的问题,但我不知道在我的情况下该怎么做 我有我的问题模型,其中一个问题可以有许多问题依赖关系question\u dependency是另一个模型,我保存两个问题之间的依赖类型。因此,我的表单向用户显示了几个问题来定义依赖项。具体如下: <%= form_for [@exercise, @question] do |f| %> <%= render 'shared/error_messages', object: f.object %> <

我看到了一大堆类似的问题,但我不知道在我的情况下该怎么做

我有我的问题模型,其中一个问题可以有许多问题依赖关系question\u dependency是另一个模型,我保存两个问题之间的依赖类型。因此,我的表单向用户显示了几个问题来定义依赖项。具体如下:

<%= form_for [@exercise, @question] do |f| %>
  <%= render 'shared/error_messages', object: f.object %>

  <div class="form-group">
    <%= f.label "Pontuação" %>
    <%= f.number_field :score, min: 0 %>
  </div>

  <div class="form-group">
    <%= f.label "Descrição" %>
    <%= f.text_area :description, class: "form-control" %>
  </div>


  <div class="box-body">
    <a style="cursor: pointer" data-toggle="collapse" data-target="#dependencies">
      <i class="fa fa-plus-square"></i> Dependências
    </a>

    <div id="dependencies" class="collapse">
      <table class="table table-condensed" style="width: 60%">
        <tbody>
          <% @questions.each do |question| %>
            <tr>
              <%= f.fields_for :dependencies do |ff| %>
                <td>
                    <%= truncate(question.description, length: 50,
                                                       separator: " ") %>
                </td>
                <td>
                  <select class="form-control" style="width: 80px">
                    <option></option>
                    <option>AND</option>
                    <option>OR</option>
                  </select>
                </td>
              <% end %>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>

  <%= f.submit yield(:button_text), class: "btn btn-primary pull-right" %>
<% end %>

依赖斯
及
或
我如何才能将此“依赖项数据”提交给我的控制器?

无论谁在之前回答(以及之后删除),谢谢。尽管有php代码,我还是通过使用
select
标记中的name属性学会了这个技巧。我相信我的问题有一个最清晰的答案,但我现在可以用这个。无论谁在之前回答过(以及之后删除),谢谢。尽管有php代码,我还是通过使用
select
标记中的name属性学会了这个技巧。我相信我的问题有一个最清晰的答案,但我现在可以用这个。