Added to_param to refer to packages by /:name
This commit is contained in:
parent
6303343c17
commit
09fc6e0113
1 changed files with 5 additions and 0 deletions
|
|
@ -29,6 +29,11 @@ class Package < ApplicationRecord
|
||||||
# order('name ASC')
|
# 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.
|
# Return the first paragraph of the long description.
|
||||||
def long_description_first_paragraph
|
def long_description_first_paragraph
|
||||||
if self.long_description
|
if self.long_description
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue