tedchoward / spree-markdown

Adds Markdown support to spree.
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

uninitialized constant Spree::ThemeSupport #1

Open christiangenco opened 10 years ago

christiangenco commented 10 years ago

ThemeSupport was removed in favor of using deface.

christiangenco commented 10 years ago

I was able to accomplish the same thing by changing the product_description method of Spree::ProductsHelper in app/overrides/products_helper.rb:

Spree::ProductsHelper.class_eval do
  def product_description(product)
    if Spree::Config[:show_raw_product_description]
      raw(product.description)
    else
      # raw(product.description.gsub(/(.*?)\r?\n\r?\n/m, '<p>\1</p>'))
      markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
      markdown.render(product.description).html_safe
    end
  end
end