J
J
JN0iZzze2014-02-13 14:35:50
phpstorm
JN0iZzze, 2014-02-13 14:35:50

Using haml for layout

For the first time I decided to try haml for layout layout in HTML. I want to use a "templater" to make it easier for me to navigate in the bulky code, namely to split the page into partial's to edit a separate block of the page in a separate file (save myself from scrolling through 1000 lines of code).
But this is exactly where the problem arose. I'm using PhpStorm for development, and when I try to compile code containing strings like this , the = render :partial => "header"compiler says: undefined method `render'
What is needed to use render? I may not understand something, but besides feeding the parameters to the compiler, is input.haml output.htmlit necessary to connect some libraries / configs and so on somewhere?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrDinckleman, 2014-10-15
@mrDinckleman

I tried to solve this problem myself. According to information found on the Internet, render is a method from Ruby on Rails. True, after installing RoR, the method still did not work.
So I use the following structure:

= Haml::Engine.new(File.read('_header.haml')).render

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question