开发者

Processing HAML from database in ruby on rails

Wondering if it's possible to process HAML from database entries. My model currently processes H开发者_开发知识库TML just fine, but I'd rather input HAML, and have the view process it into HTML.


If your view is being replaced entirely by something coming from your model/database, you can use render :inline to process it:

render :inline => @model.haml, :type => 'haml', :layout => true


Haml can be used programmatically: http://haml.info/docs/yardoc/Haml/Engine.html

There isn't enough detail in your question for me to give a more specific answer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜