【发布时间】:2012-11-22 10:02:22
【问题描述】:
我的表单目前有两个字段,下拉列表和一个输入字段。这是我的表单代码:
<div class="offset3 span6">
... # other code not relevant
<div id="topic_questions">
<%= f.simple_fields_for :topic_questions do |tq| %>
<%= tq.link_to_remove "Remove below topic" %> <br><br>
<%= tq.association :topic, collection: @topics, prompt: "Choose a topic", label: false %>
<%= tq.input :number_question, label: 'Number of questions' %>
<% end %>
<p><%= f.link_to_add "Add a topic", :topic_questions %></p>
</div> #topic_questions
</div>
这是表单的样子:
但我希望字段输入具有标签Number of questions 将在下拉列表Choose a topic 旁边。我该怎么做?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 twitter-bootstrap simple-form