Created
October 16, 2013 03:23
-
-
Save HotFusionMan/7002217 to your computer and use it in GitHub Desktop.
How to render Haml to HTML in the Rails console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include ActionView::Helpers | |
haml_code = File.open( 'path/to/haml/file' ) { |file| file.read } | |
engine = Haml::Engine.new( haml_code ) | |
puts engine.render |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment