class Tour < ActiveRecord::Base
attr_accessible :name, :program_ids
has_and_belongs_to_many :programs
end
class Program < ActiveRecord::Base
attr_accessible :name, :tour_ids
has_and_belongs_to_many :tours
end
Rails Admin HABTM Association in Views not showing select box
-
26-06-2022 - |
Question
I am customizing RailsAdmin for one of my project. I am trying to achieve multi select box like below for many to many association
My Class are different (No Teams) , I have tour and programs
Tour Class
class Tour < ActiveRecord::Base
attr_accessible :name
has_and_belongs_to_many :programs
end
Program Class
class Program < ActiveRecord::Base
attr_accessible :name
has_and_belongs_to_many :tours
end
Joint Table
class ProgramsTours < ActiveRecord::Migration
def change
create_table :programs_tours, :id => false do |t|
t.integer :program_id
t.integer :tour_id
end
end
end
This association creating an Multiple Add form with tabs as below , I am not sure how I can get that multi select box, any suggestions will be helpful.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow