Class: SofaBlog::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/sofa_blog/post.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tag_namesObject

– Attributes ——————————————————–



6
7
8
# File 'app/models/sofa_blog/post.rb', line 6

def tag_names
  @tag_names
end

Instance Method Details

#to_paramObject

– Instance Methods —————————————————–



29
30
31
# File 'app/models/sofa_blog/post.rb', line 29

def to_param
  "#{self.id}-#{title.downcase.gsub(/\W|_/, ' ').strip.squeeze(' ').gsub(/\s/, '-')}"
end