Class: SpreeAwesomeBlog::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/spree_awesome_blog/engine.rb

Class Method Summary collapse

Class Method Details

.activateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/spree_awesome_blog/engine.rb', line 7

def self.activate
  Spree::BaseHelper.module_eval do
    def link_to_rss 
      tag(:link,
        :rel => 'alternate',
        :type => "application/rss+xml", 
        :title => Spree::Config[:blog_title] || "#{Spree::Config[:site_name]} Blog",
        :href =>  posts_path(:format => :rss))
    end

    def markdown(text)
      sanitize(RDiscount.new(text).to_html)
    end
  end
  
end