我想得到下一件事...
# For ArticlesController > ApplicationController
# in view
render 'articles/edit/form'
# tries 'app/views/articles/edit/_form.html.erb'
# then tries 'app/views/articles/_form.html.erb'
# then what it wants
或者也许使用数组partial
选项渲染:
# For ArticlesController > ApplicationController
# in view
render_exists ['articles/edit/form', 'articles/new/form']
# tries 'app/views/articles/edit/_form.html.erb'
# then tries 'app/views/articles/new/_form.html.erb'
# then what it wants
这没有意识到,是吗?但也许是 3.2 或猴子补丁的一些宝石......你不知道关于它的拉取请求rails
吗?谢谢!
UPD那不是基于控制器的视图继承。这应该适用于(在同一页面上):
render `articles/edit/form`
render `comments/edit/form`