CodeandoMexico/cambia-la-ley — pull request #98 by epadillas (2014-09-26 02:04:14+00:00)
Title: Slugs

This PR introduces an error reporting function in every controller. It will output the controller and the function's name where an error was caught.

Tags are introduced. A tag is a "reforma" or a container for Laws.
Slugs (aka URL-friendly names) are introduced for Tags and Laws. Articles are now to be reached by their number instead of ID. An example URL would be: http://foo/ley/reforma-telecom/ley-de-prueba/22, where reforma-telecom is the Tag's slug, ley-de-prueba is the Law's slug, and 22 is the Article's number.

The READ and CREATE functions for Tags, Laws, and Articles are made compatible with slugs. The rest of the CRUD actions are yet to be fully implemented. It's recommended that the EDIT/UPDATE and DESTROY functions are based on the object's ID, instead of its slug.

Tags are now shown in the homepage. They can also be viewed directly via their slug (http://foo/ley/reforma-telecom), and will display all the Laws they own. For each Law, the number of Annotations and Articles will be shown like in the homepage.

The Tag's find view could use some UI improvement.