开发者

Processing HAML from database in ruby on rails

开发者 https://www.devze.com 2023-01-26 04:58 出处:网络
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 y

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

精彩评论

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