作者:狮子胯下 | 来源:互联网 | 2023-05-17 09:48
InadropdownIhavefetchedallcontrollerclasseswithalltheiractionsinanotherdropdowndynam
In a dropdown I have fetched all controller classes with all their actions in another dropdown dynamically which are used for certain operations. There are some controllers that don't have any models like 'DashboardsController' don't have Dashboard
model. It is just used to display dashboards.
在一个下拉菜单中,我将所有的控制器类都以另一个动态的下拉列表的方式来获取,这些操作用于某些操作。有些控制器没有任何模型比如DashboardsController没有仪表盘模型。它只是用来显示仪表板。
So, basically I need to filter out controllers without models. I need a method to which I pass the controller class and returns me true/false
.
基本上,我需要过滤掉没有模型的控制器。我需要一个方法,我将控制器类传递给它并返回true/false。
def has_model?(controller_klass)
# TODO
end
2 个解决方案