Class: SofaBlog::Post
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SofaBlog::Post
- Defined in:
- app/models/sofa_blog/post.rb
Instance Attribute Summary collapse
-
#tag_names ⇒ Object
– Attributes ——————————————————–.
Instance Method Summary collapse
-
#to_param ⇒ Object
– Instance Methods —————————————————–.
Instance Attribute Details
#tag_names ⇒ Object
– Attributes ——————————————————–
6 7 8 |
# File 'app/models/sofa_blog/post.rb', line 6 def tag_names @tag_names end |
Instance Method Details
#to_param ⇒ Object
– 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 |