Sha256: 518ea94a5fa3a6081f1b81ecb3d427e45360e823e93fd99dc9d98f4bf89b3609

Contents?: true

Size: 1.04 KB

Versions: 18

Compression:

Stored size: 1.04 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 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

18 entries across 18 versions & 1 rubygems

Version Path
bhf-0.6.31 app/helpers/bhf/entries_helper.rb
bhf-0.6.30 app/helpers/bhf/entries_helper.rb
bhf-0.6.29 app/helpers/bhf/entries_helper.rb
bhf-0.6.28 app/helpers/bhf/entries_helper.rb
bhf-0.6.27 app/helpers/bhf/entries_helper.rb
bhf-0.6.26 app/helpers/bhf/entries_helper.rb
bhf-0.6.25 app/helpers/bhf/entries_helper.rb
bhf-0.6.24 app/helpers/bhf/entries_helper.rb
bhf-0.6.23 app/helpers/bhf/entries_helper.rb
bhf-0.6.22 app/helpers/bhf/entries_helper.rb
bhf-0.6.21 app/helpers/bhf/entries_helper.rb
bhf-0.6.20 app/helpers/bhf/entries_helper.rb
bhf-0.6.15 app/helpers/bhf/entries_helper.rb
bhf-0.6.14 app/helpers/bhf/entries_helper.rb
bhf-0.6.13 app/helpers/bhf/entries_helper.rb
bhf-0.6.12 app/helpers/bhf/entries_helper.rb
bhf-0.6.11 app/helpers/bhf/entries_helper.rb
bhf-0.6.10 app/helpers/bhf/entries_helper.rb