これは私の前の質問に似ていますRubyOnRails Active Admin has_manyドロップダウンを変更して、別の列を使用する
再割り当てする方法を理解しましたf.inputs
が、アイテムを表示するときにデータの表示を再割り当てするにはどうすればよいですか...
例えば:
パブリックGitリポジトリ:https ://github.com/gorelative/TestApp
私が持っているコードのスニペットfillups.rb
ActiveAdmin.register Fillup do
form do |f|
f.inputs do
f.input :car, :collection => Car.all.map{ |car| [car.description, car.id] }
f.input :comment
f.input :cost
f.input :mileage
f.input :gallons
f.buttons
end
end
end