Sha256: d3626dcb41940cc7dcf90173582aed160100d484d394998847a1116355fe2783

Contents?: true

Size: 1.02 KB

Versions: 20

Compression:

Stored size: 1.02 KB

Contents

module Bhf
  module EntriesHelper
    include Bhf::ActionView::FormOptions
    
    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 reflection_title(f, field, count = 2)
      title = f.object.class.human_attribute_name(field.reflection.name)
      if field.link
        title = t("bhf.platforms.#{field.link.name}.title", count: count, default: title)
      end
      title
    end
    
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bhf-0.10.12 app/helpers/bhf/entries_helper.rb
bhf-0.10.11 app/helpers/bhf/entries_helper.rb
bhf-0.10.10 app/helpers/bhf/entries_helper.rb
bhf-0.10.9 app/helpers/bhf/entries_helper.rb
bhf-0.9.9 app/helpers/bhf/entries_helper.rb
bhf-0.9.8 app/helpers/bhf/entries_helper.rb
bhf-0.9.7 app/helpers/bhf/entries_helper.rb
bhf-0.9.6 app/helpers/bhf/entries_helper.rb
bhf-0.9.5 app/helpers/bhf/entries_helper.rb
bhf-0.9.4 app/helpers/bhf/entries_helper.rb
bhf-0.9.3 app/helpers/bhf/entries_helper.rb
bhf-0.9.2 app/helpers/bhf/entries_helper.rb
bhf-0.9.1 app/helpers/bhf/entries_helper.rb
bhf-0.9.0 app/helpers/bhf/entries_helper.rb
bhf-0.8.7 app/helpers/bhf/entries_helper.rb
bhf-0.8.6 app/helpers/bhf/entries_helper.rb
bhf-0.8.5 app/helpers/bhf/entries_helper.rb
bhf-0.8.4 app/helpers/bhf/entries_helper.rb
bhf-0.8.3 app/helpers/bhf/entries_helper.rb
bhf-0.8.2 app/helpers/bhf/entries_helper.rb