Isnor Creative
Isnor Creative Blog
Ruby, Ruby on Rails, Ember, Elm, Phoenix, Elixir, React, Vue

May 5, 2009

Wilderness CMS Rails 2.3 Engines Plugin

WildernessCMS Dashboard

I recently started working on what I thought was going to be an extension on the Bort Rails starter-site idea which I am a huge fan of. My initial idea was to include a default user admin panel but then I kept going and it evolved into something more elaborate. I’m not sure if I’m finished, or how I want it to function. At the moment it has a few different elements: the initial starter site idea, some aspects of CMS sites like WordPress or Drupal, and an aspect of default automation along the lines of things like Resource Controller or scaffold-generator type things like Streamlined.

Currently you get it from the GitHub repo and after ithe plugin is installed you can run rake:wilderness:install to get a default site. You’ll end up with all of the Bort defaults, plus a bunch of other gems and plugins: Cucumber, Webrat, Timeline Fu, Acts As taggable On Steroids, Acts As Tree, Attachment Fu, Bundle Fu, Gravatar Plugin, Hoptoad, Rakismet, Sortable Column Headers and Tiny MCE. You also get a series of default models: users, roles, permissions, tags, categories, comments, pages, articles, assets, links, menus, content areas, content blocks. You get an admin section with a dashboard that includes a timeline.

The admin section can be automated — if you drop in a new empty model and controller you can choose to inherit from the wilderness admin controllers, and take advantage of a series of automated default actions and views. The default automated views include a table and list view index view, a link to the list view shows up automtically from the index table view if you have a position column and allows sorting. Then there’s an automated detail page, new and edit pages. And a series of default Ajax actions form the table index view: delete checked, edit, show destroy. You can also configure your models to set up additional automated stuff like filters (eg filter by article: published), and search fields. or fields to omit from admin index/detail views. The admin section also includes a preferences section.

If the automated admin controllers/views are not suitable for a particular model, controller or view, it’s easy to override them. For custom views you can specify in the model an array of custom view actions. For custom actions you can drop in an into the blank controller. The replacement actions can either replace the inherited action completely and render a custom view or use the standard automated view, or the action can “super” back up to the inherited action after necessary custom code is added and then continue on as normal.

There’s also a default front end that looks like a Wordpress blog type of thing with articles, comments (including Rakismet spam filtering), pages, archives, a basic non-fulltext search, rss feeds for articles and comments, categories, links (blogroll), categories and tags. By default the front end layout is configured on the fly using content areas and content blocks along the lines of Drupal: in the admin panel you can create a series of nested content areas (div tags in other words), and then in a content area you can assign a content block. A content block will look for a partial of the same name to render in the content blocks folder (eg Footer Logo looks for footerlogo.html.erb partial).

Flowplayer and the 1-pixel out audio player are included for video and audio playback. Text editing uses TinyMCE and there’s a custom file uploader and Ajax-paginated image gallery included. Comment spam is handled by Rakismet, and comments include Gravatar avatars.

There’s still a lot left to be figured out. One thing is a good way to do themes. Also I would like to consolidate it, clean it up and add further test coverage. Have also been thinking of adding actsasparanoid, actsasversioned and or actsasdraftable, and generally fleshing it out more, eg to make all/more items belong to user, make more things use the publish boolean, maybe fleshing out the links model a bit further, etc.

Gordon B. Isnor

Gordon B. Isnor writes about Ruby on Rails, Ember.js, Elm, Elixir, Phoenix, React, Vue and the web.
If you enjoyed this article, you may be interested in the occasional newsletter.

I am now available for project work. I have availability to build greenfield sites and applications, to maintain and update/upgrade existing applications, team augmentation. I offer website/web application assessment packages that can help with SEO/security/performance/accessibility and best practices. Let’s talk

comments powered by Disqus