Adapting the project to use rails4

Update of gems used on project.
Change of link_to_function to just link_to.
Using pattern of Rails 4 in models and controller.