在下面,隐式渲染是否会在SpecialArticlesController
中被调用?或者它会被跳到ArticlesController
中的隐式渲染?
class SpecialArticlesController < ArticlesController
def index
...
super
end
end
class ArticlesController
def index
...
end
end
答案 0 :(得分:0)
除非您显式渲染两次,否则不会出现双重渲染错误。此代码将导致错误:
class ParentController < ApplicationController
def index
render
end
end
class ChildController < ParentController
def index
render
super
end
end
以下代码不会导致错误:
class ParentController < ApplicationController
def index
end
end
class ChildController < ParentController
def index
super
render
end
end