开发者

rdiscount + haml in Rails 3 problem

开发者 https://www.devze.com 2023-01-30 14:31 出处:网络
Ok, I hope this is a simple typo or something, but I\'ve got a problem trying to get HAML to print markdown text. The relevant port开发者_如何学Cion of my gemfile looks like this:

Ok, I hope this is a simple typo or something, but I've got a problem trying to get HAML to print markdown text. The relevant port开发者_如何学Cion of my gemfile looks like this:

gem 'rdiscount'

My text looks like this:

### TEST HEADING ###
Here's some text.

My view code looks like this:

%h1= @article.title
.body
  :markdown
    = @article.body

but what renders on the page is:

Article Title

= @article.body

So not only is it not formatting the markdown, it's not even outputting the content of @article.body.

Any help?


You should use this instead:

%h1= @article.title
.body
  :markdown
    #{@article.body}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号