app/controllers/concerns/adminpanel/rest_actions.rb in adminpanel-2.5.2 vs app/controllers/concerns/adminpanel/rest_actions.rb in adminpanel-2.5.3
- old
+ new
@@ -112,10 +112,14 @@
resource = controller_name.singularize.to_sym
"#{resource}_params"
end
def set_resource_instance
- @resource_instance = @model.find(params[:id])
+ if @model.respond_to? :friendly
+ @resource_instance = @model.friendly.find(params[:id])
+ else
+ @resource_instance = @model.find(params[:id])
+ end
end
def set_resource_collection
@collection = @model.all
end