Sha256: 53c1dde4b4a0456ef8b2f4481a1e65d8a2d1916b973fee7244a2861cad756c04

Contents?: true

Size: 715 Bytes

Versions: 21

Compression:

Stored size: 715 Bytes

Contents

module RailsConnector

  #
  # This module contains a helper that can be used to build a table of contents of an object.
  #
  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.
    #
    def table_of_contents(obj)
      obj.sorted_toclist.reject { |o| not o.permitted_for_user?(current_user) }
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
infopark_rails_connector-6.8.0.210.ed204b0 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.110.6570b45 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.72.d18d096 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.23.da7f96b app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.16.def5e85 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.15.a24f5ff app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.891.647580e app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.889.d503e42 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.883.f5f063b app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.884.4bd86e6 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.869.9609b39 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.856.8c0fec5 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.809.bdfa8c3 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.785.05d4af9 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.744.99f67fc app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.720.44fbabd app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.713.e5c3150 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.681.7c84f4a app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.663.ceecdee app/helpers/rails_connector/table_of_contents_helper.rb
infopark_rails_connector-6.8.0.beta.200.650.7c93155 app/helpers/rails_connector/table_of_contents_helper.rb