我从来没有见过这样的错误,所以我什至不知道我的应用程序的哪些信息要与你分享。我将“地址”模型放入“客户模型”中。这是错误。(编辑)我使用SprintApp作为我的应用程序的指南。他们也有一个地址模型,他们的客户模型是我的客户模型。
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
我知道在不显示我的代码的情况下很难要求答案,但我们至少可以开始对话,我可以编辑和添加需要的内容。提前致谢。
客户控制器
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
%>