simple_formプラグインを使用してこのフォームがあります。
<%= simple_form_for([@video, @video.comments.new], :remote => true) do |f| %>
<%= f.association :comment_title, :collection => @video.comment_titles, :label => "Comment Title:", :include_blank => false %>
<%= f.input :body, :label => false, :placeholder => "Post a comment." %>
<%= f.button :submit, :value => "Post" %>
<% end %>
これにより、次の行のドロップダウンリストが作成されます。
<%= f.association :comment_title, :collection => @video.comment_titles, :label => "Comment Title:", :include_blank => false %>
comment_title
私の質問は、各ドロップダウンアイテムがそれぞれの個別のショービューへのリンクになるように、このコードをどのように変更するかです。
アップデート
これが最初の答えのコードから生成されたhtmlです:
<select class="select optional" id="comment_comment_title_id" name="comment[comment_title_id]">
<option value="<a href=" comment_titles="" 224"="">#<CommentTitle:0x10353b890>">#<CommentTitle:0x10353b890></option>
<option value="<a href=" comment_titles="" 225"="">#<CommentTitle:0x1035296e0>">#<CommentTitle:0x1035296e0></option>
<option value="<a href=" comment_titles="" 226"="">#<CommentTitle:0x1035295a0>">#<CommentTitle:0x1035295a0></option>
</select>