missing partial when putting a model in another model

I have never seen an error like this, so I don't even know what information of my app to share with you. I am putting an 'address' model inside a 'customer model'. Here is the error. (edit)I am using SprintApp as a guide for my app. They too also have a addess model, and their clients model is my customers model.

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

I know its hard to ask for an answer without showing my code, but we can atleast start the dialogue and i can edit and add whats needed. Thanks in advance.

customers controller

    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

Customers _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 
%>

Addresses _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 
%>

Answers


When you say you're putting an 'address' model inside of the 'customer' model, I'm assuming you mean the form, which I'm assuming means that you're placing two forms in the same view?

Either way, we'd need what view you are trying to display, as well as the invoking controller. My initial guess is that you're namespacing- something like Admin::CustomersController, but you haven't run generators to generate views from active_admin.

Never used active_admin, but as per the docs, have you tried running the following?

rails generate active_admin:assets

Check the same error as indicated by Kwent and the solutions as follows:

Also see the following error:

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]}.

The error also indicates that you are missing a partial as listed in the error log.

For example:

The partial file _form.html.erb should be in app/views/admin/customers folder. Same is for others.

Then you should render your partial like: <%= render :partial => "form" %> in your controller.

Hope this will help you!


Need Your Help

Reading data from SQL server “no data present” error message

c# sql ms-access-2010

I am trying to read data from a SQL server that is migrated into Access 2010. In my program, I have a form that full of combo boxes that you can choose a certain date that you can pull info from th...

Hiding Subreports in SQL Report (RDL)

sql report rdl

I have a bunch a reports that are printed out and mailed to clients. At the top of the report is the return address, left aligned. I was asked to add an optional logo to the report. This logo shoul...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.