Sha256: 4484e82376b8c4e745d62d0728435cae98cc75db1a90ff3523ef0d51257a9b84
Contents?: true
Size: 1.09 KB
Versions: 17
Compression:
Stored size: 1.09 KB
Contents
module Bhf module EntriesHelper def node(f, field, &block) render partial: 'bhf/helper/node', locals: {f: f, field: field, input: with_output_buffer(&block)} end def definition_item(object, column, &block) render partial: 'bhf/helper/definition_item', locals: {object: object, column: column, content: with_output_buffer(&block)} end def reflection_node(f, field, &block) return if !f.object.respond_to?(field.reflection.name) || (field.form_type == :static && f.object.new_record? && f.object.send(field.reflection.name).blank?) render partial: 'bhf/helper/reflection_node', locals: { f: f, field: field, input: with_output_buffer(&block) } end def is_image?(file) ! file.match(/\.png|\.jpg|\.jpeg|\.gif|\.svg/i).nil? end def reflection_title(f, field) title = f.object.class.human_attribute_name(field.reflection.name) if field.link title = t("bhf.platforms.#{field.link}.title", count: f.object.send(field.reflection.name).to_a.count, default: title) end title end end end
Version data entries
17 entries across 17 versions & 1 rubygems