ID unique to nested model, not unique globally?

前端 未结 1 1485
时光取名叫无心
时光取名叫无心 2021-01-26 13:18

I have nested routes for a has_many and belongs_to relationship.

resources :websites, :path => \'w\' do
    resources :pages, :path => \'\'
end
         


        
1条回答
  •  情深已故
    2021-01-26 13:47

    Adding scope might be an answer:

    friendly_id :name, :use => :scoped, :scope => :website
    

    0 讨论(0)
提交回复
热议问题