Rails Activeadmin - custom association select box
Yes, that is possible. I assume you want to use a DropDown list box for members
to select a user from User
model.
form do |f|
f.inputs do
f.input :user_id, :label => 'Member', :as => :select, :collection => User.all.map{|u| ["#{u.last_name}, #{u.first_name}", u.id]}
f.input :description
end
end
Create active admin input dropdown using words array
form do |f|
f.input :gender, collection: ["Male", "Female"]
..
end
active admin association not showing dropdown list of category
In addition to the ActiveRecord relationship you need to register the belongs_to with ActiveAdmin:
ActiveAdmin.register Blog do
belongs_to :category, optional: true
See the ActiveAdmin documentation for more details.
ActiveAdmin: Not saving association between my two models
Try
permit_params :image, room_id
f.collection_select :room_id, Room.all, :id, :listing_name
Related Topics
Ruby on Rails: What Reporting And/Or Charting Tools Are Available
How to Generate a Random Date in Ruby
Differencebetween Methods and Attributes in Ruby
Neither Ruby and Nor Irb Can Load .Rb File in Current Directory
Convert JSON String to JSON Array in Rails
How to Use Nokogiri to Parse an Xml File
Rubymine - No Ruby Interpreter Configured for the Project
Ruby: Put Request with JSON Body
Rails Activeadmin: Showing Table of a Related Resource in the Same View
Creating an Empty File in Ruby: "Touch" Equivalent
Setting Ruby Hash .Default to a List
Cannot Install Aptana Plugin on Eclipse 4.2
Building a Windows Executable from My Ruby App
Ruby: Get All Keys in a Hash (Including Sub Keys)
Checking If a Method Is Defined on the Class
How to Use Rails and Paperclip to Store Photos on Google Cloud Storage
Ruby: How to Pass All Parameters and Blocks Received by One Method to Another