has_many :through メソッドを使用して多対多の関係を設定し、複数選択フィールドを使用して関係を設定しようとしています。私はこのチュートリアルに従っています:
http://asciicasts.com/episodes/185-formtastic-part-2
ただし、何らかの理由でフォームに奇妙な 16 進数が表示され、ページが更新されるたびに変更されます。何が間違っているのか正確にはわかりません。以下は私のモデル/ビューコードです。
company.rb
has_many :classifications
has_many :sics, :through => :classifications
sic.rb
has_many :classifications
has_many :companies, :through => :classifications
分類.rb
belongs_to :company
belongs_to :sic
_form.html.erb
<% semantic_form_for @company do |f| %>
<% f.inputs do %>
<%= f.input :company %>
<%= f.input :sics %>
<% end %>
<%= f.buttons %>
<% end %>
また、フォームはフィールドの正しいエントリ数を表示しているように見えますが、関係の正しい名前を明らかに示していません。
SIC マルチセレクト http://web9.twitpic.com/img/103694166-98ad71116216d3d1b12dd77690b36248.4bf6ca20-full.jpg