2013-12-08 72 views
0

一個命名空間模型的實例我有這樣的模式:如何創建的Rails 3

class Backend::Enterprise < ::Enterprise 

我怎麼能調用,並在其命名空間中實例化這個模式?

如果我寫,在backend_enterprises_controller

@enterprise = Enterprise.find(1) 

它調用模型:

class Enterprise < ActiveRecord::Base 

而且我想在每個命名空間模型分離的方法。

可能嗎?我使用Rails 3.2.14和inherited_resources gem。

謝謝。

回答

1

也許我誤解你的問題,但你嘗試過

@enterprise = Backend::Enterprise.find(1) 

相關問題