Answer the question
In order to leave comments, you need to log in
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.html
it necessary to connect some libraries / configs and so on somewhere?
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question