I am trying to render in another partial, like this:
<% cobran = @detalleco.cobran %>
$("#cobran_<%= @detalleco.IdCobranza %>").fadeOut(500, function(){
$(this).remove();
$(".child").remove();
$("#container_cobranza").html("<%=escape_javascript(render(:partial => 'cobranza/cobran', cobranza: cobran))%>");
});
but I get this error:
ActionView::Template::Error (undefined local variable or method cobran' for #<#<Class:0xb47692ec>:0x83cb1500>
Did you mean? cobran_url):
1: <tr id="cobran_<%= cobran.id %>">
2: <td><%=cobran.id%>
3:
4:
app/views/cobranza/_cobran.html.erb:1:in
_app_views_cobranza__cobran_html_erb__36360536__1042659538'
app/views/detallecob/create.js.erb:12:in `_app_views_detallecob_create_js_erb__76211164__1041949938'
don't recognize the variable "cobran" because in the view is doing the render this way:
<tbody id="container_cobranza">
<%= render @cobranza %>
</tbody>
And in the partial puts the singular of "cobranza" that is "cobran" like this:
<tr id="cobran_<%= cobran.id %>">
<td><%=cobran.id%>
<td><%=cobran.FechaReg%></td>
<td><%=cobran.FechaVence%></td>
<td><%=cobran.TipoDoc%></td>
</tr>
How can I solve this issue? thanks