Changed injection before end instead of after keyword which is not consistent in versions of rails. Added condition to generator for rails 4 or early version of rails for strong parameter change