ActiveAdmin - вложенные пути отношений has_one - PullRequest
0 голосов
/ 09 марта 2020

Как мне сделать вложенные маршруты has_one в ActiveAdmin?

class Parent
  has_one :child
end

class Child
  belongs_to :parent
end

# ActiveAdmin:
ActiveAdmin.register Parent do
end

ActiveAdmin.register Child do
  belongs_to :parent, optional: true
end


resources :parents do
  resources :child # Singular
end

Используемый мной маршрут edit_parent_child_path(parent, child)

Я получаю ошибку ActionController::RoutingError (uninitialized constant ChildController

Но если я сохраню маршрут в Plural, я получу: No Method Error, undefined method child for Parent

Так как мне сделать вложенные отношения has_one в ActiveAdmin?

...