Skip to content

Generator adminpanel:gallery

Jose Ramon edited this page Mar 10, 2015 · 8 revisions

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

Clone this wiki locally