Skip to content

Instantly share code, notes, and snippets.

@kobeumut
Last active December 21, 2017 05:45
Show Gist options
  • Save kobeumut/79ea9461066e861d8305bb0d04645009 to your computer and use it in GitHub Desktop.
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
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