CartoDB/cartodb — pull request #1537 by viddo (2014-12-18 19:24:50+00:00)
Title: DRY'er construction of new-dashboard route URLs

This is a proposed solution to the discussion in the [pull request](https://github.com/CartoDB/cartodb/pull/1475#discussion_r21918706) where the datasets view for the new dashboard was implemented. I had some concerns that the URLs were hardcoded inside the views instead of having a clear place where constructed.

**Proposed solution:** encapsulate the URL construction inside a model that is given accessible through the Router, `router.urls`. Its responsibility is to give getters of URL's within the scope of the routes.

Other URLs that are not within the dashboard router's scope (directs to other pages, e.g. `/tables/my_dataset`) need to be handled elsewhere (not addressed in this PR).

The URL construction is fairly OO/imperative, but is simple and should be good enough for our current use-case.

Further rationales for other changes:
- renamed vars related to router to use a consistent vocabulary, as defined by [Backbone.Router docs](http://backbonejs.org/#Router) (i.e. router, fragment etc.)
- renamed router model's attribute `model` to `content_type` to make it clearer what value the variable represents (IMHO, model was too generic and misleading)
- added a view helper to pluralize strings to DRY code
- camelCase some vars to adhere to code guidelines