モデル「スタートアップ」と他のモデル「カテゴリ」があります。2つのテーブルが関連付けられています。
カテゴリアのデータをスタートアップのフォームに呼び出したいのですが、このカテゴリはチェックボックスで表示されます。フォームのスタートアップフォームの中に、categorie_idがあります。これはコードです
<%= form_for(@startup) do |f| %>
<% if @startup.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@startup.errors.count, "error") %> prohibited this startup from being saved:</h2>
<ul>
<% @startup.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :description %><br />
<%= f.text_area :description %>
</div>
<div class="field">
<%= f.collection_select :round_id, Round.order(:name), :id, :name, include_blank: true %>
</div>
<div class="field">
<%= f.label :category %><br />
<%= f.text_field :category_id %>
</div>
<div class="field">
<%= f.collection_select :country_id, Country.order(:name), :id, :name, include_blank: true %>
</div>
<div class="actions">
<%= f.submit %> </div> <% end %>
チェックボックスを使用してフォーム内のカテゴリのデータを表示するにはどうすればよいですか?
何か案が。
pdt:私の英語は本当に悪いです。