I need to render a partial inside ActiveAdmin page. I am trying something like:
  form(:html => { :multipart => true }) do |f|
    f.inputs "Описание товара #{f.object.name if f.object.name}" do
      f.input :name, :required => true
      f.input :brand
      f.input :category
      f.input :created_at, :wrapper_html => { :class => 'inline-list' }
      f.input :updated_at, :wrapper_html => { :class => 'inline-list' }
      f.actions
    end
    content do
      render partial: 'fancybox'
    end
  end
But it doesn't work. My partial contents replace the form contents. I guess I need a right wrapper element for render but using panel was no success. Any thoughts?
Try to use render with f.template:
form(:html => { :multipart => true }) do |f|
  f.inputs "Описание товара #{f.object.name if f.object.name}" do
    f.input :name, :required => true
    f.input :brand
    f.input :category
    f.input :created_at, :wrapper_html => { :class => 'inline-list' }
    f.input :updated_at, :wrapper_html => { :class => 'inline-list' }
    f.actions
  end
  f.inputs "Fancybox" do
    f.template.render partial: 'fancybox'
  end
end
                        You can also go with following
f.render partial: 'folder/partial page' unless f.object.new_record?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With