View the Project on GitHub codn/adminpanel
To add attachments to a wysiwyg field, you need to mount an uploader with the
name of the relation’s model and add uploader => :trixfiles
to your
wysiwyg hash.
mount_uploader :trixfiles
# ...
def self.form_fields
[
# ...
{
'body' => {
'type' => 'wysiwyg_field',
'uploader' => :trixfiles,
'images' => true,
'label' => 'Cuerpo',
'show' => 'false'
},
},
]
end
module Adminpanel
class Trixfile < Image
include Adminpanel::Base
mount_uploader :file, TextAttachmentUploader
end
end
def whitelisted_params
params.require(:somet).permit(
# ...
trixfile_ids: [],
# ...
)
end