Sha256: 35a4caf03f59ea974830ce2eccf384ae39f90ab79a8a87a46602dfbefa5ee42d
Contents?: true
Size: 592 Bytes
Versions: 19
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true module PagesCore class FormBuilder < ActionView::Helpers::FormBuilder include ActionView::Helpers::TagHelper include PagesCore::LabelledFormBuilder def image_file_preview(attribute) return "" unless object.send(attribute) && !object.send(attribute).new_record? tag.p( @template.dynamic_image_tag(object.send(attribute), size: "120x100") ) end def image_file_field(attribute, options = {}) safe_join [image_file_preview(attribute), file_field(attribute, options)] end end end
Version data entries
19 entries across 19 versions & 1 rubygems