Skip to content

Commit

Permalink
Merge pull request #4235 from illogikal/master
Browse files Browse the repository at this point in the history
add edit action to id_column if show action not available
  • Loading branch information
timoschilling committed Dec 10, 2015
2 parents 24029e2 + 3157f2d commit bafecff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/active_admin/views/index_as_table.rb
Expand Up @@ -270,6 +270,8 @@ def id_column
column(resource_class.human_attribute_name(resource_class.primary_key), sortable: resource_class.primary_key) do |resource|
if controller.action_methods.include?('show')
link_to resource.id, resource_path(resource), class: "resource_id_link"
elsif controller.action_methods.include?('edit')
link_to resource.id, edit_resource_path(resource), class: "resource_id_link"
else
resource.id
end
Expand Down

0 comments on commit bafecff

Please sign in to comment.