Rails4

Adapted the application for Rails 4