Class: Kublog::Category

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/kublog/category.rb

Instance Method Summary collapse

Instance Method Details

#as_json(params = {}) ⇒ Object

Includes a path to the category by default helps reference back to edited categories in json requests



22
23
24
25
# File 'app/models/kublog/category.rb', line 22

def as_json(params={})
  params||={}
  super(params.merge!({:methods => [:path]}))
end

#to_sObject



15
16
17
# File 'app/models/kublog/category.rb', line 15

def to_s
  self.name.titleize
end