Stolen from https://github.com/raw1z/cargo_wiki and updated to support rails 4.0 since this person has not updated the gem in nearly a year.