Added to_param to refer to packages by /:name

This commit is contained in:
Christoph Haas 2021-02-18 01:57:33 +01:00
parent 6303343c17
commit 09fc6e0113

View file

@ -29,6 +29,11 @@ class Package < ApplicationRecord
# order('name ASC')
# }
# Define the parameter(s) used for a /package/:name URL to an instance of this model
def to_param
name
end
# Return the first paragraph of the long description.
def long_description_first_paragraph
if self.long_description