-
Notifications
You must be signed in to change notification settings - Fork 0
Keppler File Input
Anyelo Petit edited this page Jul 28, 2018
·
7 revisions

Keppler File Input está basado en Bootstrap File Input
Repositorio de GitHub: https://github.com/kartik-v/bootstrap-fileinput
= f.input :image, as: :keppler_file
# Migration
t.jsonb :images
# Controller
params.require(:gallery).permit( { images: [] })
# Form
= f.input :images, as: :keppler_file, multiple: true
= f.input :images, as: :keppler_file, type: %w[image video audio pdf]
= f.input :images, as: :keppler_file, type: %w[image], formats: [jpg jpeg png svg]
= f.input :videos, as: :keppler_file, type: %w[video], formats: [mp4 mkv opg avi]
= f.input :audios, as: :keppler_file, type: %w[audio], formats: [mp3]
= f.input :images, as: :keppler_file, max_size: 5000 # default 225 (KB)
= f.input :images, as: :keppler_file, max_preview_size: 5000 # default 25600 // 25 MB
Nota: el input posee un script interno para cada input_id con configuración de lenguaje con el idioma actual e íconos de Simple Line Icon, así como para los tipos y formatos disponibles y para la vista previa cuando el campo ya existe y tiene registros guardados.
Powered by Keppler