Class: Blogelator::Tag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Blogelator::Tag
- Defined in:
- app/models/blogelator/tag.rb
Instance Method Summary collapse
-
#to_param ⇒ String
Uses the slug as the :id parameter in URLs.
-
#url(request = nil) ⇒ String
The URL for the blog post.
Instance Method Details
#to_param ⇒ String
Uses the slug as the :id parameter in URLs
12 13 14 |
# File 'app/models/blogelator/tag.rb', line 12 def to_param slug end |
#url(request = nil) ⇒ String
The URL for the blog post.
18 19 20 21 22 23 24 25 26 |
# File 'app/models/blogelator/tag.rb', line 18 def url(request = nil) @url ||= begin if request.try(:ssl?) "https://#{ENV.fetch('HOST')}/blog/tags/#{slug}" else "http://#{ENV.fetch('HOST')}/blog/tags/#{slug}" end end end |