2013-06-25 87 views
0

我有我的應用程序的視圖在這裏我使用命令渲染這樣Problema與軌道

<table class="table table-striped table-condensed"> 
     <thead> 
      <tr> 
       <th>ID</th> 
       <th>Nombre</th> 
       <th>Descripcion</th> 
       <th>Fecha Creacion</th> 
       <th>Prioridad</th> 
       <th>Fecha Limite</th> 
       <th></th> 
      </tr> 
     </thead> 
     <tbody> 
      <%= render :file => "/notes/_pendientes.html.erb" %> 
     </tbody> 
    </table> 

但是,當我要去看看該指數在應用程序的開始這看起來像一個視圖此

http://i.stack.imgur.com/dUTGT.jpg

和在控制器我有這樣

@pendientes = Note.where變量( '埃斯塔=?',真)
@finalizadas = Note.where( '埃斯塔=?',假)

我不知道爲什麼是顯示在指數的開頭信息

感謝您的幫助

回答

0

在你/notes/_pendientes.html.erb文件(你沒有顯示),有一個Rails編碼錯誤。我想你可能有一個<%= ... %>的東西,你應該只有<% ... %>。你只想要<%= ... %>如果你想顯示封閉的紅寶石代碼的輸出。如果你正在做這樣的事情的一種形式:

<% @foos.each do |foo| %> 
... some HTML and interleaved erb stuff here ... 
<% end %> 

你不想在第一條語句(不<%= @foos.each do |foo| %>)的=

而且,你行:

<%= render :file => "/notes/_pendientes.html.erb" %> 

我以爲會是比較合適的:

<%= render :partial => "/notes/pendientes" %> 

但是,這似乎並沒有引起問題。

+0

jajajajajajajajajaj原因只是一個= 非常感謝:D – Andru1989

+0

@AndresFelipeVizcainoRestrep很酷! – lurker

+0

如果你的父視圖在'notes'文件夾中,你可以'渲染'pendientes'' –