updated to work with rails 4 templates