Last active
December 21, 2017 05:45
-
-
Save kobeumut/79ea9461066e861d8305bb0d04645009 to your computer and use it in GitHub Desktop.
Ruby on rails add user references to company and display an email instead of an object in active admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register Company do | |
permit_params :user_id, :name ## Add this line | |
form do |f| | |
f.inputs "Admin Details" do | |
f.input :user_id, as: :select, collection: User.all.map { |a| [a.email, a.id] } | |
f.input :name | |
f.actions | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment