<commit_before>messages_id = active_scaffold_messages_id
if controller.send(:successful?)
  if render_parent? && controller.respond_to?(:render_component_into_view)
    render_parent_options
    if render_parent_action == :row
      # TODO: That s not working with delete....
      page << "ActiveScaffold.delete_record_row('#{element_row_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}", :action => 'list', :id => params[:id])}','#{url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))}');"
      messages_id = active_scaffold_messages_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}")
    elsif render_parent_action == :index
      parent_rendered = controller.send(:render_component_into_view, render_parent_options)
      page << parent_rendered
    end
    #page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}
  elsif (active_scaffold_config.delete.refresh_list)
    page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false)
  else
    page << "ActiveScaffold.delete_record_row('#{element_row_id(:action => 'list', :id => params[:id])}','#{url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))}');"
    page.call 'ActiveScaffold.replace',  active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}
  end
else
  flash[:error] = active_scaffold_error_messages_for(@record, :object_name => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :header_message => '', :message => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :container_tag => nil, :list_type => :br)
end
page.call 'ActiveScaffold.replace_html', messages_id, render(:partial => 'messages')
<commit_msg>changed syntax to erb<commit_after><%messages_id = active_scaffold_messages_id%>
<%if controller.send(:successful?)%>
  <%if render_parent? && controller.respond_to?(:render_component_into_view)%>
    <%render_parent_options%>
    <%if render_parent_action == :row%>
      <%# TODO: That s not working with delete....%>
      ActiveScaffold.delete_record_row('<%=element_row_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}", :action => 'list', :id => params[:id])%>', '<%=url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))%>');
      <%messages_id = active_scaffold_messages_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}")%>
    <%elsif render_parent_action == :index%>
      <%= escape_javascript(controller.send(:render_component_into_view, render_parent_options))%>
    <%end%>
    <%#page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
  <%elsif (active_scaffold_config.delete.refresh_list)%>
    ActiveScaffold.replace('<%=active_scaffold_content_id%>', '<%=escape_javascript(render(:partial => 'list', :layout => false))%>');
  <%else%>
    ActiveScaffold.delete_record_row('<%=element_row_id(:action => 'list', :id => params[:id])%>', '<%=url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))%>');
    <% if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
      ActiveScaffold.replace('<%=active_scaffold_calculations_id%>', '<%=escape_javascript(render(:partial => 'list_calculations'))%>');
    <% end %>
  <%end%>
<%else%>
  <%flash[:error] = active_scaffold_error_messages_for(@record, :object_name => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :header_message => '', :message => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :container_tag => nil, :list_type => :br)%>
<%end%>
ActiveScaffold.replace_html('<%=messages_id%>', '<%=escape_javascript(render(:partial => 'messages'))%>');
{'fraction_non_alphanumeric': 0.1928876884987621, 'fraction_numerical': 0.0018005851901868107, 'mean_word_length': 6.921568627450981, 'pattern_counts': {'":': 4, '<': 38, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7574060', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1541, 'n_words': 217}