This is similar to my previous question. Ruby On Rails Active Admin has_many changes the drop-down list to use a different column
I figured out how to reassign f.inputs , but how can I redistribute the display of data when viewing an element ...
f.inputs
eg:
Public Git Repo: https://github.com/gorelative/TestApp
Code snippet that I have in my fillups.rb
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
Change show action
show
ActiveAdmin.register Fillup do # ... other stuff show do attributes_table do # add your other rows row :id row :car do |fillup| link_to fillup.car.description, admin_car_path(fillup.car) end end end end
Source: https://habr.com/ru/post/1387231/More articles:rails activeadmin drop-down menu in new and editable forms - ruby ββ| fooobar.comIs it possible to animate movement and fading in text using CSS3? - cssRuby On Rails Active Admin has_many changes the drop-down list to use a different column - ruby ββ| fooobar.comHow to use a DLL without the need for .h and .lib files in a VC ++ 6.0 project? - c ++Special HTML character encoding - javaAndroid bitmap - best practice - androidHow to associate a directory with my application - c ++javax.imageio.ImageIO reading invalid RGB values ββin grayscale images - javaMy batch jpg resizer works with color images, but grayscale gets blurry - javaHow to redirect a TWebBrowser control to a custom URL? - redirectAll Articles