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.
精彩评论