我想未來的事情......Ruby on Rails的:局部視圖繼承
# 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或monkeypatches ...並不知道拉請求rails
呢?謝謝!
UPD這不是基於控制器的視圖繼承。這應該適用於(在同一頁):
render `articles/edit/form`
render `comments/edit/form`
我知道。那是別的。我是頁面中的一個對象的'所有者',而其他的則是'客人'。即兩條評論,第一條是我的。對於'comment''''edit'形式不等於'new'形式,但對於'article's它們是相等的。 – Kuraga