Tre*_*ott 8 html ruby-on-rails erb indentation
我有几个部分,我包括在我的Rails中application.html.erb file,但生成的HTML不保留我的缩进(格式化).我被告知第一行使用与调用相同的缩进级别进行渲染_partial.html.erb,但部分中的所有后续行都会左对齐.
这会产生类似的代码(请参阅我的定位评论):
<body>
<div id="outer">
<div class="contentwidth main">
<div class="logo"> <<<<< Shouldn't be this far to the right
<h1><a href="index.html">minimal.</a></h1>
</div><!-- end logo --> <<<<<<< Shouldn't be way over to the left
Run Code Online (Sandbox Code Playgroud)
有没有办法更好地使用ERB修复此格式/格式化我包含的部分?或者我需要使用HAML吗?
| 归档时间: |
|
| 查看次数: |
2164 次 |
| 最近记录: |