lib/scaffold_logic/helper.rb in scaffold_logic-1.7.0 vs lib/scaffold_logic/helper.rb in scaffold_logic-1.7.1

- old
+ new

@@ -48,18 +48,18 @@ # # <td class="crud_links"><%= crud_links_for_actions_and_paths(:show => model_path) -%></td> def crud_links_for_actions_and_paths(actions_and_paths) _html = '' - [:show, :edit, :destroy].each do |action| + [:destroy, :edit, :show].each do |action| next unless actions_and_paths.key?(action) if action == :show - _html << link_to(image_tag('icons/view.png', :class => 'crud_icon', :width => 14, :height => 14), actions_and_paths[action], :title => "View") + _html << link_to(image_tag('icons/view.png', :class => 'crud_icon', :width => 14, :height => 14), actions_and_paths[action], :title => 'View') elsif action == :edit - _html << link_to(image_tag('icons/edit.png', :class => 'crud_icon', :width => 14, :height => 14), actions_and_paths[action], :title => "Edit") + _html << link_to(image_tag('icons/edit.png', :class => 'crud_icon', :width => 14, :height => 14), actions_and_paths[action], :title => 'Edit') elsif action == :destroy - _html << link_to(image_tag('icons/delete.png', :class => 'crud_icon', :width => 14, :height => 14), actions_and_paths[action], :confirm => 'Are you sure? This action cannot be undone.', :method => :delete, :title => "Delete") + _html << button_to('', actions_and_paths[action], :class => 'delete_crud_icon', :confirm => 'Are you sure? This action cannot be undone.', :method => :delete) end end _html.html_safe end