我從來沒有見過這樣的錯誤,所以我甚至不知道我的應用的哪些信息與您分享。我在'客戶模式'中放置了一個「地址」模型。這是錯誤。 (編輯)我使用SprintApp作爲我的應用程序的指南。他們也有一個addess模型,他們的客戶模型就是我的客戶模型。將模型放在另一個模型中時缺少部分
ActionView::MissingTemplate in Admin/customers#new
Showing /usr/local/rvm/gems/ruby-1.9.3-p392/bundler/gems/active_admin-fa7e4de2d5fa/app/views/active_admin/resource/new.html.arb where line #1 raised:
Missing partial admin/customers/form, active_admin/resource/form, active_admin/base/form, inherited_resources/base/form, application/form with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :arb, :coffee, :haml]}. Searched in:
* "/Users/danielhatcher/rails/print/app/views"
* "/usr/local/rvm/gems/ruby-1.9.3-p392/bundler/gems/active_admin-fa7e4de2d5fa/app/views"
* "/usr/local/rvm/gems/ruby-1.9.3-p392/gems/kaminari-0.14.1/app/views"
* "/usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.3/app/views"
Extracted source (around line #1):
1: insert_tag renderer_for(:new)
Rails.root: /Users/danielhatcher/rails/print
Application Trace | Framework Trace | Full Trace
我知道它很難要求一個答案不顯示我的代碼,但我們可以ATLEAST開始對話,我可以編輯和添加需要什麼。提前致謝。
客戶控制器
ActiveAdmin.register Customer do
# Menu item
menu :label => "Customers", :parent => "Administration"
index do
column :name
end
form :partial => "form"
show :title => :name do
panel "Client Details" do
attributes_table_for resource do
row :name
row :email
row :phone
row :created_at do
resource.created_at.humanize
end
row :updated_at do
resource.updated_at.humanize
end
end
text_node(render :partial => "addresses/show", :locals => { :address => resource.address })
end
end
end
客戶_form
<%=
semantic_form_for @customer, :builder => ActiveAdmin::FormBuilder do |f|
f.inputs "Customer Information" do
f.input :name
f.input :email
f.input :phone
render :partial => "addresses/form", :locals => { :form => f }
f.buttons
end
%>
地址_form
<%=
form.inputs "Address" do
form.semantic_fields_for :address do |address|
address.inputs :class => "" do
address.input :street
address.input :city
address.input :state, :as => :select, :collection => States::all.invert
address.input :zip, as: :string
end
end
end
%>
你的app/views/active_admin/resource/new.html.arb是怎麼樣的? – 2013-05-01 12:39:03
我的文件結構停在app/views/active_admin。此後我什麼也沒有。我一直在關注一個開源項目,給自己一個指導,他們的代碼也沒有那樣的文件。 – DhatchXIX 2013-05-01 12:41:40