Sha256: 6137d4c9f851bdff4c00f163194ab29807ff32bc37b1db237c4bb35919df5e3b

Contents?: true

Size: 749 Bytes

Versions: 35

Compression:

Stored size: 749 Bytes

Contents

module RailsConnector

  #
  # This module contains a helper that can be used to build a table of contents of an object.
  #
  # @api public
  module TableOfContentsHelper

    #
    # The <tt>table_of_contents</tt> helper method gets an object as argument and returns an array,
    # which can be used as the table of contents of the given object.
    #
    # The returned array consists of the child objects of the given object.
    # The array is sorted according to the configured sort order and the sort keys.
    # It also contains only objects which the current user is permitted to view.
    #
    # @api public
    def table_of_contents(obj)
      obj.sorted_toclist.reject { |o| not o.permitted_for_user?(current_user) }
    end
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
infopark_fiona_connector-7.0.1.5.2.3.rc4 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.beta2 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.0 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-6.10.0.beta1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_cloud_connector-7.0.1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_cloud_connector-7.0.0 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_cloud_connector-6.9.5 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.9.4 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.9.3.1.36404185 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.9.2.1.125136549 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.9.1.3.22208381 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.9.0.3.197272233 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.174.51542603 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.115.227021242 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.73.75172665 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.2.153416031 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.67.110847540 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.3.1.23895778 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.2.36.82613853 app/helpers/rails_connector/table_of_contents_helper.rb