Ruby on rails 如何呈现作用域路由的部分自控制器?
我想知道如何从链接到模型范围的自定义控制器操作渲染局部 本案涉及三种模式Ruby on rails 如何呈现作用域路由的部分自控制器?,ruby-on-rails,scope,partials,Ruby On Rails,Scope,Partials,我想知道如何从链接到模型范围的自定义控制器操作渲染局部 本案涉及三种模式 一个流,它有许多 剪辑其中有许多 注释 在streams/show中,我正在渲染clips/all\u clips,它有两个按钮用于对剪辑进行排序(“最近”和“最新评论”) 有关路线: resources :clips do collection do get :recent get :most_comments end end 这就是我被卡住的地方,我不知道如何从clips\
- 一个
,它有许多流
其中有许多剪辑
注释
streams/show
中,我正在渲染clips/all\u clips
,它有两个按钮用于对剪辑进行排序(“最近”和“最新评论”)
有关路线:
resources :clips do
collection do
get :recent
get :most_comments
end
end
这就是我被卡住的地方,我不知道如何从clips\u控制器将其渲染为片段:
def recent
# What goes here?
end
def most_comments
# What goes here?
end
resources :clips do
collection do
get :recent
get :most_comments
end
end
def recent
# What goes here?
end
def most_comments
# What goes here?
end