I would start by spending a week or two wrapping the application in Acceptance tests (cucumber/capybara) just so when you do make a change you are able to quickly find out to a semi decent level of confidence things are ok.
I would also recommend Working Effectively with Legacy Code By Robert C. Martin.
Good luck!