public
Description: A resourceful plugin providing lightweight blog functionality to Rails applications
Homepage:
Clone URL: git://github.com/vigetlabs/bloget.git
bloget / README.rdoc
100644 51 lines (28 sloc) 1.963 kb

Bloget

(rhymes with blasé)

Bloget is a plugin application that gives you a simple weblog.

When you install Bloget, some lightweight controllers, models, and views will be copied into your Rails application. You will most likely override things in these models and controllers and edit these views.

Bloget uses polymorphic associations for its idea of a poster, or an object that can make weblog posts and comments. This is so you can easily integrate it into your application.

Requirements

Other plugins

Bloget does not require any other plugins. However, some are useful.

You need some way to handle authentication. The RESTful Authentication plugin will work for this seamlessly. If you use something else, you must define the methods +logged_in?+ and current_user in ApplicationController. current_user must return an object that can match up with Bloget’s poster object.

The Will Paginate plugin is also not necessary, but very useful. Bloget will detect it and paginate.

Integration

Integrating with a user model or other posting-enabled model

In your model:

    include Bloget::Models::Poster

Templates

By default, the controllers specify a layout of "bloget," which is installed with Bloget. You can override this in the copied controllers.

This layout references +bloget.css+, which is installed in your +public/stylesheets+ directory.

Routes

You will need to add these routes, or routes like them, to +config/routes.rb+:

    map.resources :posts do |post|
      post.resources :comments
    end

If you would like to show your posts at the URL ’/blog’, you may want to add the following routes:

    map.with_options :controller => 'posts', :conditions => {:method => :get} do |bloget|
      bloget.blog '/blog', :action => 'index'
      bloget.formatted_blog '/blog.:format', :action => 'index'
    end

Copyright © 2007-2008 Clinton R. Nixon of Viget Labs, released under the MIT license