Skip to content

Generator adminpanel:gallery

joseramonc edited this page Dec 15, 2014 · 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 adminpaenl/product.rb

  • Add productfiles_attributes: [:id, :file, :_destroy] to the whitelisted attributes

Clone this wiki locally