how to ignore the path of a file from git status after adding the files to .gitignore?

I have a git repository , where I have *.iml files. To ignore them I have added below to .gitignore


Now when I run git status, I dont see the .iml files, but I still see the path of the files in red. enter image description here

How can I get rid of this?