jeudi 22 novembre 2018

Rails customizing the administrate gem

I have location, concert and artist model as

class Location < ApplicationRecord
  has_many :concerts, dependent: :destroy
  has_many :artists, through: :concerts
end

class Concert < ApplicationRecord
  belongs_to :location
  belongs_to :artist
end

class Location < ApplicationRecord
  has_many :concerts, dependent: :destroy
  has_many :artists, through: :concerts
end

I'am currently using the rails administrate, now I want to customise the rails administrate gem where instead of displaying the id while adding the new concert I want to get the location and artist name there instead of there id's. I have attached the screenshot there.enter image description here

Aucun commentaire:

Enregistrer un commentaire