开发者

rdiscount + haml in Rails 3 problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜