comfy/comfortable-mexican-sofa — pull request #379 by modsognir (2013-11-27 17:44:08+00:00)
Title: Refactor ContentController and other classes

Okay, this is a big one so let me walk through the things i've done here and why:

* Split out Asset actions into another controller. They were essentially separate within the ContentController anyway - this just delegates the responsibility to an area that makes more sense.
* Refactored ContentController. This was the main driver for my changes. I needed to implement a json API but it was difficult with the way that CMS forces render_html as the default mode of choice. Changing this to use respond_with allows the possibilities of extra output methods without much change required. This will now output a pretty basic JSON representation; I don't think theres any sensitivity on listing these items as is (see screenshot) but welcome to hear any arguments against and implement a more select JSON representation.
![screen shot 2013-11-27 at 17 28 51](https://f.cloud.github.com/assets/103191/1633484/a89627e2-5789-11e3-966a-e23f727401e3.png)

* Converted module namespaces.
This turned items such as:
```ruby
class Cms::Class
end
```
into:
```ruby
module Cms
class Class
end
end
```
This was required for some of the functionality and i've tried to apply it as generally as possible. Note that I had some weird errors in the Layout class so i've not converted that yet.

Anyway, let me know if you have any questions or issues with this pull request and i'd be happy to amend.