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