0
我有這段代碼,我試圖從我的視圖中調用,但沒有成功。傳遞塊給部分幫手
# app/viwes/admin/index.html.haml
= panel title: "My title" do
%h2 Hello!
# app/helpers/admin/suggestion_helper.rb
module Admin::SuggestionHelper
def panel(locals, &block)
render({partial: "admin/shared/panel"}, locals, &block)
end
end
# app/views/admin/shared/_panel.html.haml
%h1= title
%div= yield
這導致了這個錯誤'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path.
,這是爲什麼?
我正在使用Rails 4.0.5
。