Nischay Namdev
Nischay Namdev

Reputation: 593

How to render another resource's form in active admin dashboard - Rails?

Well I have a bill resource and I want the form of bill resource to be displayed in active admin dashboard.MY code look likes ->

apps/views/admin/dashboard/_form.html.arb

 active_admin_form_for bill do |f|
    f.semantic_errors *f.object.errors.keys
    inputs 'Enter the bill details' do
       input :amount
       input :is_paid        
       actions
    end
 end

dashboard.rb

 ActiveAdmin.register_page "Dashboard" do    
   menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }    
      content title: proc{ I18n.t("active_admin.dashboard") } do    
        form render 'form'
      end
 end

But I am getting only black space for this form in dashboard! pls help me out !

Upvotes: 4

Views: 647

Answers (1)

Jawad Khawaja
Jawad Khawaja

Reputation: 756

Try replacing your render line with render partial: 'form'

Upvotes: 1

Related Questions