Fixed no method error for rails 4.1.