adding slugs to schools and categories

This commit is contained in:
Jared Cosulich 2017-03-16 16:09:54 -04:00
parent 683fc31c5d
commit 1db61cd3e5
13 changed files with 42 additions and 12 deletions

View file

@ -9,6 +9,9 @@ class Category < ApplicationRecord
scope :for_parent, -> (category=nil) { where(parent_category_id: category.try(:id)) }
include FriendlyId
friendly_id :name, :use => [:slugged]
def path
p = self
items = [p]