Sha256: 818f87beab52cc139299f3d13b535a26af6c499128ef3c053ed9720e9dd0a779

Contents?: true

Size: 1 KB

Versions: 21

Compression:

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

21 entries across 21 versions & 1 rubygems

Version Path
bhf-1.0.0.beta16 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta15 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta14 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta13 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta12 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta11 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta10 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta9 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta8 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta7 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta6 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta5 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta4 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta3 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta2 app/helpers/bhf/entries_helper.rb
bhf-1.0.0.beta1 app/helpers/bhf/entries_helper.rb
bhf-0.10.17 app/helpers/bhf/entries_helper.rb
bhf-0.10.16 app/helpers/bhf/entries_helper.rb
bhf-0.10.15 app/helpers/bhf/entries_helper.rb
bhf-0.10.14 app/helpers/bhf/entries_helper.rb