Display partial ActiveAdmin edit page

I need to make a partial part of ActiveAdmin. 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 that will not work. My partial content replaces the contents of the form. I think I need the right shell element for render , but using panel was unsuccessful. Any thoughts?

+6
source share
1 answer

Try using 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 
+20
source

Source: https://habr.com/ru/post/954665/


All Articles