フォームで選択するコレクション (@displayable_collection) を作成しようとしています
(これは、最終的に @displayable_collection に入る単純化されたバージョンです)
これが私のコードです...しかし、機能していません.....何が間違っていますか?
controller do
before_filter :populate_collection, :only => [:new, :edit]
private
def populate_collection
@displayable_collection = ArtItem.all.map{ |item| [item.to_s, "#{item.class}_#{item.id}"]}
end
end
form do |f|
f.inputs 'Details' do
f.input :project
f.input :name
end
f.inputs 'Display Items' do
f.has_many :display_items do |item|
item.input :displayable_combined_fields, :collection => @displayable_collection
item.input :location, :input_html => {:selected => location.id}
item.input :height
item.input :width
item.input :depth
end
end
f.actions
end