update example to rails 4