<commit_before><% url_options ||= params_for(:action => form_action)
   xhr = request.xhr? if xhr.nil?
   as_action_config = active_scaffold_config.send(form_action)
   body_partial ||= 'form' %>
<%=
options = {:onsubmit => onsubmit,
           :id => element_form_id(:action => form_action),
           :multipart => as_action_config.multipart?,
           :class => "as_form #{form_action.to_s}",
           :method => method,
           'data-loading' => true}
if xhr && as_action_config.multipart? # file_uploads
  form_remote_upload_tag url_options.merge({:iframe => true}), options
else
  options[:remote] = true if xhr && !as_action_config.multipart?
  form_tag url_options, options
end -%>

  <h4><%= headline -%></h4>

  <div id="<%= element_messages_id(:action => form_action) %>" class="messages-container">
<% if request.xhr? -%>
    <% records = @error_records || Array(@record)
       records.each do |record| %>
       <%= active_scaffold_error_messages_for record, :object_name => "#{record.class.model_name.human.downcase}#{record.new_record? ? '' : ": #{record.to_label}"}" %>
    <% end   %>
<% else -%>
    <%= render :partial => 'form_messages' %>
<% end -%>
  </div>

  <%= render :partial => body_partial, :locals => { :columns => as_action_config.columns } %>

  <p class="form-footer">
    <%= submit_tag as_(form_action), :class => "submit" %>
    <%= link_to(as_(:cancel), main_path_to_return, :class => 'as_cancel', :remote => true, 'data-refresh' => false) if cancel_link %>
    <%= loading_indicator_tag(:action => form_action, :id => params[:id]) %>
  </p>

</form><commit_msg>bugfix: cancel_link in create form not working if create.link.page=true (issue:60 reported by victor-ono)<commit_after><% url_options ||= params_for(:action => form_action)
   xhr = request.xhr? if xhr.nil?
   as_action_config = active_scaffold_config.send(form_action)
   body_partial ||= 'form' %>
<%=
options = {:onsubmit => onsubmit,
           :id => element_form_id(:action => form_action),
           :multipart => as_action_config.multipart?,
           :class => "as_form #{form_action.to_s}",
           :method => method,
           'data-loading' => true}
cancel_options = {:class => 'as_cancel', 'data-refresh' => false}

if xhr && as_action_config.multipart? # file_uploads
  form_remote_upload_tag url_options.merge({:iframe => true}), options
else
  if xhr && !as_action_config.multipart?
    options[:remote] = true
    cancel_options[:remote] = true
  end
  form_tag url_options, options
end -%>

  <h4><%= headline -%></h4>

  <div id="<%= element_messages_id(:action => form_action) %>" class="messages-container">
<% if request.xhr? -%>
    <% records = @error_records || Array(@record)
       records.each do |record| %>
       <%= active_scaffold_error_messages_for record, :object_name => "#{record.class.model_name.human.downcase}#{record.new_record? ? '' : ": #{record.to_label}"}" %>
    <% end   %>
<% else -%>
    <%= render :partial => 'form_messages' %>
<% end -%>
  </div>

  <%= render :partial => body_partial, :locals => { :columns => as_action_config.columns } %>

  <p class="form-footer">
    <%= submit_tag as_(form_action), :class => "submit" %>
    <%= link_to(as_(:cancel), main_path_to_return, cancel_options) if cancel_link %>
    <%= loading_indicator_tag(:action => form_action, :id => params[:id]) %>
  </p>

</form>
{'fraction_non_alphanumeric': 0.18065855829130822, 'fraction_numerical': 0.0017798872738059924, 'mean_word_length': 4.010401188707281, 'pattern_counts': {'":': 2, '<': 47, '<?xml version=': 0, '>': 88, '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': '922661', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1141, 'n_words': 216}