Use resource_name instead of resource.class