ActiveScaffold :: Wiki
Override order of Action links

This may be hack-ish but it works.

1. copy vendor/plugins/active_scaffold/frontends/default/views/_list_actions.rhtml to the views directory of the controller you wish to modify.

2. change the code to look similar to this…


<table cellpadding="0" cellspacing="0">
  <tr>
    <td class="indicator-container">
      <%= loading_indicator_tag(:action => :record, :id => record.id) %>
    </td>
    <% myHash = {} %>
    <% active_scaffold_config.action_links.each :record do |link| -%>
      <% next if controller.respond_to? link.security_method and !controller.send(link.security_method) -%>
      <% myHash[link.label] = link -%>
    <% end -%>
    <% ['Edit', 'Delete', 'Show', '[Show Details]', '[Edit Details]'].each do |link| %>
      <td>
        <%= record.authorized_for?(:action => myHash[link].crud_type) ? render_action_link(myHash[link], url_options) : "<a class='disabled'>#{myHash[link].label}</a>" -%>
      </td>
    <% end -%>
  </tr>
</table>

In this case I added two new links: [Show Details] and [Edit Details]
changing the array with label names allows you to respect the security checks while still putting the links into the order you want to.

TODO Using an array declared at the controller level instead of a hard coded or even better, extend the action_links to hold it.