Closed francesco-loreti closed 7 years ago
I couldn't understand your intention. Could you provide example use case with following things?
For example,
example.haml:
%foo
$ hamlit render example.haml
<div class='foo'></div>
0
And as you may know, example above is already implemented. So I want some other Rails-specific use case that can't be done with it.
Thanks.
If I use ERB I can user ERB.new for render inside my application an erb file. More or less as http://blog.revathskumar.com/2014/10/ruby-rendering-erb-template.html
In HAMLIT is it possible?
Possible. Sorry for poor documentation.
foo = "hello world"
ERB.new("<%= foo %>").result(binding) #=> "hello world"
is the same as:
foo = "hello world"
eval(Hamlit::Engine.new.call("= foo"), binding) #=> "hello world"
and:
Hamlit::Template.new { "= foo" }.render(nil, { foo: "hello world" }) #=> "hello world"
HI! Is it possible to implement the possibility to execute the HAMLIT commands into rails application? Because, for example, I can render a template from command line out of rails program("hamlit rendere filename.html.haml") but not inside application or into rails console.
Thanks