Updated generator template for Rails 4 compatibility