HAML processing from a ruby ​​database on rails

I wonder if it is possible to handle HAML from database records. My model currently handles HTML just fine, but I would rather introduce HAML and process it in HTML.

+4
source share
2 answers

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

There are not enough details in your question to give a more specific answer.

+4
source

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

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

All Articles