[英]Active admin not finding partial in show
這應該非常簡單,嘗試在show action中呈現活動管理員的部分內容:
對象名稱是:清單
ActiveAdmin.register Listing do
show do
attributes_table do
row :foo
row :bar
render 'map'
end
end
end
我在app/admin/listings/_map.html.haml
下添加了部分
我收到找不到模板的錯誤:
Missing partial admin/listings/_map, active_admin/resource/_map, active_admin/base/_map, inherited_resources/base/_map, application/_map with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :arb, :haml, :jbuilder]}.
還嘗試在此處添加: app/admin/_map.html.haml
和admin/listings/_map.html.haml
並嘗試:將渲染移到attributes_table
之外,如下所示:
show do
render 'map'
attributes_table do
row :foo
row :bar
...
正常rails', '4.1.9'
, 'activeadmin', '~> 1.0.0.pre1'
您的視圖應放在views
目錄中:
app/views/admin/listings/_map.html.haml
渲染部分應如下所示:
show do
render partial: 'map'
# ...
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.