View the Project on GitHub codn/adminpanel
The command rails generate adminpanel:gallery product
is going to create the files/migrations necessary for the gallery for Adminpanel::Product
. After the command is run you’ll have to:
Add the productfile to the form_field hash:
{
'productfiles' => {
'type' => 'adminpanel_file_field',
'label' => 'productfiles'
}
}
Add mount_images :productfiles
to adminpanel/product.rb
Add { productfiles_attributes: [:id, :file, :_destroy] }
to the whitelisted attributes