refactor: improve countries find_resource method

- Update `find_resource` method to use `scoped_collection.friendly.find(params[:id])`

This refactoring improves the find_resource method to work with friendly URLs, making it more robust and user-friendly.
This commit is contained in:
songtianlun 2025-01-25 01:29:50 +08:00
parent 84c224cf8d
commit 5bc06007b2

View File

@ -1,4 +1,9 @@
ActiveAdmin.register Country do
controller do
def find_resource
scoped_collection.friendly.find(params[:id])
end
end
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#