I have a large number of image files in my project but all of them have spaces in them which was causing issues on github. I need to change them all using rails console and add '-' instead of a spaces. I know it is possible but can't get it. Used this to move and change a single filename:
cd app/assets/images && mv avatar.png avatar123.png