我有这个 HAML
-content_for :primary_content do
#available-disclosures-container
.message-container.information-container
%h3=(t "headings.influencers.disclosures.new")
%p=raw((t "influencers.instructions.disclosures.new"))
=render "sidebar/disclosures/list", :disclosures => Disclosure.basics, :show_link => true, :selectable => true, :usable => false
#disclosure-form-container{:style => "display:none;"}
= form_for([:sidebar,@disclosure], :html => {:id => "disclosure-form", :remote => true}) do |f|
我不知道为什么,但最后一行:
= form_for([:sidebar,@disclosure], :html => {:id => "disclosure-form", :remote => true}) do |f|
导致此错误:
undefined method `model_name' for NilClass:Class
和
6: =render "sidebar/disclosures/list", :disclosures => Disclosure.basics, :show_link => true, :selectable => true, :usable => false
7:
8: #disclosure-form-container{:style => "display:none;"}
9: = form_for([:sidebar,@disclosure], :html => {:id => "disclosure-form", :remote => true}) do |f|
10: %p
11: =f.label :display_as, (t :select_disclosure_type)
12: =f.select :display_as, options_from_collection_for_select(Disclosure.basics, :display_as, :name, f.object.display_as)
知道是什么元素导致了这个问题吗?
谢谢!