Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
CHANGELOG | Fri Jul 18 13:45:59 -0700 2008 | |
| |
MIT-LICENSE | Fri Jul 18 13:45:59 -0700 2008 | |
| |
README.rdoc | Sun Jul 20 13:11:26 -0700 2008 | |
| |
Rakefile | Fri Jul 18 13:45:59 -0700 2008 | |
| |
generators/ | Sun Aug 31 23:07:41 -0700 2008 | |
| |
init.rb | Fri Jul 18 13:45:59 -0700 2008 | |
| |
install.rb | Mon Jul 21 07:36:44 -0700 2008 | |
| |
lib/ | Sun Jul 20 13:11:43 -0700 2008 | |
| |
tasks/ | Fri Jul 18 13:45:59 -0700 2008 | |
| |
test/ | Fri Jul 18 13:45:59 -0700 2008 | |
| |
uninstall.rb | Fri Jul 18 13:45:59 -0700 2008 |
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
Edge Rails
Bloget requires Edge Rails. It is being developed on revision 7661 currently, although it is known to work with revisions at least two weeks before that.
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
In your user model:
has_one :blogger, :as => :poster
has_many :posts, :as => :poster
has_many :comments, :as => :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







