0
我有此導軌ActiveAdmin belongs_to的admin_inicio_bannerhomes_path()
class Inicio < ActiveRecord::Base
has_many :bannerhomes
end
class Bannerhome < ActiveRecord::Base
belongs_to :inicio
end
和activeAdmin有這種
ActiveAdmin.register Inicio do
sidebar "Project Details" do
ul do
li link_to("Bannerhome", admin_inicio_bannerhomes_path(Inicio))
#it dont work with Inicio and inicio, why dont work?
#li link_to("Bannerhome", admin_inicio_bannerhomes_path(1))
#when i pass 1 it works, but i want every Bannerinicio that belongs to Inicio with id=1
end
end
end
ActiveAdmin.register Bannerhome do
belongs_to :inicio
end
我有一個與INICIO ID = 1和4 Bannerhome使用id = 1,2,圖3和4,每一個都inicio_id = 1
即時遵循這個文檔 http://www.activeadmin.info/docs/2-resource-customization.html#belongs_to
謝謝。