2011-11-03 48 views
1

我已经在我的js.erb下列文件:麻烦当地人和谐音使用Rails

$('#menu').after($("<%=escape_javascript(render 'boards/customize', :board => @board, :templates => @templates, :types => @types)%>") 

所以我尝试一些当地人传递给我的部分

在我_customize.html.erb

<div id="customize"> 
      <ul id="categories"> 
      <% @types.each do |type|%> 
      <li><%=link_to type.name, change_type_board_path(board, :type_id => type.id), :remote => true %></li> 
      <% end %> 
     </ul> 
     <div id='carousel'> 
      <%=render 'boards/carousel', :templates => templates %> 
     </div> 
    </div> 

I get the following error: 

undefined local variable or method板”为#<#:0x00000103893e48`>

你应该如何将这些变量传递给Rails中的partials?

回答

1

在Rails 3:

render :partial => 'boards/customize', 
     :locals => { :board => @board , :templates => @templates, :types => @types }