fix sample code in Readme and add in support for rails 4