Metadata

Related resources

The related_resources method allows to find and display a list of similar resources from the same collection. Similarity is calculated using the TF-IDF algorithm on the content of each resource.

Usage

To get a list of the 5 most similar resources, call the method on any resource instance.

# app/views/content/posts/show.html.erb
@resource.related_resources

# Just the 3 most similar resources
@resource.related_resources(limit: 3)
Edit this page