我有一个包含父类和子类对象的源,我使用RABL渲染成json。我将根对象包含在json中。 事情是这样的=>根据什么先来,JSON中的根节点将与相应的类生成。 我需要它是所有的父类。 举例如下: Class Klass
...
Class SubclassOfKlass < Klass
...
k = Klass.create
s = SubclassOfKlass.create
我有一个问题,同时增加了新的方法到控制器 ,下面是详细信息: matches_controller.rb def index
@matches = Match.all
render rabl: @matches
end
def current
@matches = Match.find_by_sql("SELECT * FROM `TEST`.`matches