app/views/kuppayam/workflows/parrot/row.js.erb in kuppayam-0.1.34 vs app/views/kuppayam/workflows/parrot/row.js.erb in kuppayam-0.1.35
- old
+ new
@@ -1,8 +1,15 @@
<% if @r_object && @r_object.errors.blank? %>
+ <%
+ locals = {@resource_options[:item_name].to_sym => @r_object, i: -1}
+ if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
+ locals.merge!(@row_partial_locals)
+ end
+ %>
+
// Updating the edited row and highlighting it
- $("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: { @resource_options[:item_name].to_sym => @r_object, i: -1})) %>");
+ $("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: locals)) %>");
$("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
<% if @resource_options[:show_modal_after_update] %>
// Refresh the modal content if it is open
$("#div_<%= @resource_options[:item_name] %>_show").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>")