2013-06-25 168 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'' –