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
。