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

Version Path
bhf-0.7.15 app/helpers/bhf/entries_helper.rb
bhf-0.7.14 app/helpers/bhf/entries_helper.rb
bhf-0.7.13 app/helpers/bhf/entries_helper.rb
bhf-0.7.12 app/helpers/bhf/entries_helper.rb
bhf-0.7.11 app/helpers/bhf/entries_helper.rb
bhf-0.7.9 app/helpers/bhf/entries_helper.rb
bhf-0.7.8 app/helpers/bhf/entries_helper.rb
bhf-0.7.7 app/helpers/bhf/entries_helper.rb
bhf-0.7.5 app/helpers/bhf/entries_helper.rb
bhf-0.7.4 app/helpers/bhf/entries_helper.rb
bhf-0.7.3 app/helpers/bhf/entries_helper.rb
bhf-0.7.2 app/helpers/bhf/entries_helper.rb
bhf-0.7.1 app/helpers/bhf/entries_helper.rb
bhf-0.7.0.rc3 app/helpers/bhf/entries_helper.rb
bhf-0.7.0.rc2 app/helpers/bhf/entries_helper.rb
bhf-0.7.0.rc1 app/helpers/bhf/entries_helper.rb
bhf-0.6.32 app/helpers/bhf/entries_helper.rb