Class: Blogaze::Models::Tag

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/blogaze/models/tag.rb

Overview

Tags model

Instance Method Summary collapse

Instance Method Details

#before_saveObject



25
26
27
# File 'lib/blogaze/models/tag.rb', line 25

def before_save
  self.slug = Innate::Helper::CGI.u(self.name.scan(/\w+/).join('-')).downcase
end

#hrefString

Returns the URI to the page listing posts belonging to the tag.

Returns:

  • (String)


21
22
23
# File 'lib/blogaze/models/tag.rb', line 21

def href
  "/tags/#{slug}"
end