iwa*_*bed 3 haml ruby-on-rails syntax-error
我试图在HAML中干掉一些代码,但似乎偶然发现了一个空白错误,我无法完全理解.
我拿起标题并离开导航代码并将其放入文件layouts夹中各自的文件中.
在常规视图文件中,我将它放在顶部:
= render 'layouts/header'
  = render 'layouts/left_navigation'
  / center content column
  .centerContent.left.phm.rbm
    / start main center section
    / and the rest of the code goes below here
在header文件中,我有:
/ main container area
#maincontainer
  / main content
  #maincontent.mhauto
在left navigation文件中,我有:
/ left navigation column
#leftNav.leftNav.left
  / a bunch of code goes in here
/ end left navigation column
现在,我希望这相当于:
/ main container area
#maincontainer
  / main content
  #maincontent.mhauto
    / left navigation column
    #leftNav.leftNav.left
      / a bunch of code goes in here
    / end left navigation column
    / center content column
    .centerContent.left.phm.rbm
      / start main center section
      / and the rest of the code goes below here
但无论出于何种原因,它都无法正常工作,而是syntax error, unexpected keyword_ensure, expecting $end在指向文件的最后一行时给出了这种语法错误.我究竟做错了什么?这是我第一次使用HAML,所以这对我来说非常困惑.
顺便说一下,在我开始干掉代码之前,它工作得很好,所以这对我来说似乎是一个空白的东西.
你有一个嵌套在另一个渲染中的渲染..我认为这就是问题所在:
= render 'layouts/header'
= render 'layouts/left_navigation'
/ center content column
.centerContent.left.phm.rbm
  / start main center section
  / and the rest of the code goes below here
| 归档时间: | 
 | 
| 查看次数: | 2053 次 | 
| 最近记录: |