<commit_before><%
record = list_record if list_record # compat with render :partial :collection
tr_class = cycle("", "even-record")
tr_class += " #{list_row_class(record)}" if respond_to? :list_row_class
url_options = params_for(:action => :list, :id => record.id)
-%>

<tr class="record <%= tr_class %>" id="<%= element_row_id(:action => :list, :id => record.id) %>" class="record">
  <% active_scaffold_config.list.columns.each do |column| %>
    <% column_value = render_column(record, column) -%>
    <% column_value << "&nbsp;" if column_value.nil? or column_value.empty? # For IE6 -%>

    <td class="<%= column_class(column, column_value) %>" >
      <% if column.link -%>
        <% link_url_options = url_options.merge(:link => column_value) -%>
        <% link_url_options = link_url_options.merge(:id => record.send(column.association.name).id, :parent_model => column.association.active_record, :parent_column => column.association.name.to_s) if column.singular_association? -%>
        <%= record.authorized_for?(:action => column.link.crud_type) ? render_action_link(column.link, link_url_options) : "<a class='disabled'>#{column_value}</a>" -%>
      <% else -%>
        <%= column_value %>
      <% end -%>
    </td>
  <% end -%>
  <% if active_scaffold_config.action_links.any? {|link| link.type == :record } -%>
  <td class="actions">
    <%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options} %>
  </td>
  <% end -%>
</tr>

<% target_id = element_row_id(:action => :list, :id => record.id) -%>
<script type="text/javascript">
actions = new ActiveScaffold.Actions.Record(
  $$('#<%= target_id -%> a.action'),
  $('<%= target_id -%>'),
  $('<%= loading_indicator_id(:action => :record, :id => record.id) -%>'),
  {refresh_url: '<%= url_for params_for(:action => :row, :id => record.id, :_method => :get, :escape => false) -%>'}
);
</script><commit_msg>A little more logic needed on the singular association link. If association is blank then disable the link.<commit_after><%
record = list_record if list_record # compat with render :partial :collection
tr_class = cycle("", "even-record")
tr_class += " #{list_row_class(record)}" if respond_to? :list_row_class
url_options = params_for(:action => :list, :id => record.id)
-%>

<tr class="record <%= tr_class %>" id="<%= element_row_id(:action => :list, :id => record.id) %>" class="record">
  <% active_scaffold_config.list.columns.each do |column| %>
    <% column_value = render_column(record, column) -%>
    <% column_value << "&nbsp;" if column_value.nil? or column_value.empty? # For IE6 -%>

    <td class="<%= column_class(column, column_value) %>" >
      <% if column.link -%>
        <% link_url_options = url_options.merge(:link => column_value) -%>
        <% valid_link = record.authorized_for?(:action => column.link.crud_type) %>
        <% if column.singular_association? %>
          <% if record.send(column.association.name) %>
            <% link_url_options = link_url_options.merge(:id => record.send(column.association.name).id, :parent_model => column.association.active_record, :parent_column => column.association.name.to_s) -%>
          <% else %>
            <% valid_link = false %>
          <% end %>
        <% end %>
        <%= valid_link ? render_action_link(column.link, link_url_options) : "<a class='disabled'>#{column_value}</a>" -%>
      <% else -%>
        <%= column_value %>
      <% end -%>
    </td>
  <% end -%>
  <% if active_scaffold_config.action_links.any? {|link| link.type == :record } -%>
  <td class="actions">
    <%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options} %>
  </td>
  <% end -%>
</tr>

<% target_id = element_row_id(:action => :list, :id => record.id) -%>
<script type="text/javascript">
actions = new ActiveScaffold.Actions.Record(
  $$('#<%= target_id -%> a.action'),
  $('<%= target_id -%>'),
  $('<%= loading_indicator_id(:action => :record, :id => record.id) -%>'),
  {refresh_url: '<%= url_for params_for(:action => :row, :id => record.id, :_method => :get, :escape => false) -%>'}
);
</script>
{'fraction_non_alphanumeric': 0.20227713178294573, 'fraction_numerical': 0.00048449612403100775, 'mean_word_length': 4.010922330097087, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 118, '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': '5702936', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1404, 'n_words': 267}