Fix template for compatibility with Rails 4