Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time



Governor (named after Rod Blagojevich) is the pluggable blogging platform for Rails, built for people who want to build their blog into their website, not build their website into their blog.


  • Rails 3.0 (Rails 3.1+ not supported)

  • ActiveRecord

Various plugins have their own dependencies. By 1.0, I'd like to make it possible to use Governor with other ORMs, but I'm not sure when that'll be.

Setting Up

First, add Governor to your Gemfile.

gem 'governor'

and run bundle install. Now you're ready to add a model:

rails generate governor:create_articles [CLASS_NAME]

CLASS_NAME by default is Article, but feel free to specify something else, like Post, Blog, whatever. This will add a model, migration, and route to your app.

If you already have a model and you want to add Governor, you just need to include Governor::Article in your model. You'll also need to add a route as follows (assuming your model is called Article):

governate :articles


Now that you have an article model and a set of routes, you're ready to plug it into your app. I'd recommend running `rake routes` to see what routes have been added, as they depend on the model name you chose.

You can add a Governor Management bar to your app by calling governor_header in your view:

<% if user_logged_in_or_whatever? # whatever logic you want to use %>
  <%= governor_header %>
<% end %>

Plugins can hook into this header to add their own management tool links.

Next, go ahead and add some plugins!


Governor checks to see if any of the popular authentication schemes are in place, and should work with Devise, Authlogic, and Clearance. If you're using something else, It's fairly easy to plug in to Governor. Running the following generator will add an initializer to your app:

rails generate governor:configure

Here's a snippet from the generated initializer:

# How to reference the author of an article = do
  if defined?(Devise)
  elsif respond_to?(:current_user)
    raise "Please define Run `rails generator governor:configure` to install an initializer."

Replace the block with your own code. This will allow you to define app-specific definitions for the author of an article; authorization rules for editing/deleting articles; and what the application should do if someone breaks those rules.


If you'd like to customize the views, you can run the rails generator:

rails generate governor:views


Less of a roadmap as a politician's promise of what will exist in future versions of Governor:

  • A better-documented plugin API.

  • More plugins.

    • Asset Management (uploading photos etc)

    • Web-based admin interface

    • slugs, or /yyyy/mm/dd/slug-styled URLs

  • Plugin integration testing to make sure 1 plugin doesn't break others

  • More consistent i18n support

  • The ability for a plugin to modify the rendering of an existing element on the page.


Until v1.0 (or at least until things start to stabilize), I won't promise anything regarding backwards compatibility. Please let me know if something you were relying on breaks, and I'll do my best to steer you in the right direction or repair functionality.

Contributing to Governor

Governor is just getting off the ground now, so while there's a lot to implement, the infrastructure might be too shaky to support multiple developers. Still, if you're interested in improving this, let's talk.



  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution



Copyright © 2011 Liam Morley. See LICENSE.txt for further details.


because "Blogojevich" would be too tough to remember. It's a pluggable blogging system for Rails 3.0.



You can’t perform that action at this time.