Sha256: 7a19c155960aad823368a19aef9a2b9f2aa557fe03ec4acb8bc803f7bc33c35c

Contents?: true

Size: 1.79 KB

Versions: 8

Compression:

Stored size: 1.79 KB

Contents

= Muck Blogs

Add a blog to any object.

== Setup
Install the gem:
  sudo gem install muck-blogs

Then add it to your environment.rb:
  config.gem "muck-blogs", :lib => 'muck_blogs'
  
Add tasks to your application's Rakefile:
  require 'muck_blogs/tasks'
  
Installing the gem will also install dependencies.  Specifically Muck Blogs requires Muck Contents.  Be sure
to properly configure your application for Muck Contents - http://github.com/jbasdf/muck_contents/tree/master
== Usage

=== Configuration
Add 'enable_post_activities' to global_config.yml to determine whether or not an activity will be added
after a user contributes a post.  This requires that the application be configured to use Muck Activities.
Note that to enable this functionality the content model will need to have 
  enable_post_activities: true

=== Blog model
Create a model called blog in your project and add the following:
  class Blog < ActiveRecord::Base
    acts_as_muck_blog
  end
This let's you override or add other methods to the blog model that you see fit.

=== Content model
Muck Blogs requires Muck Contents.  Be sure to setup Muck Content then add acts_as_muck_post to your Content model:
  class Content < ActiveRecord::Base
    acts_as_muck_post
    # acts_as_activity_source # Include this if you wish to have entries added to activity feeds upon each new post
  end

=== Attach blogs to a model:
For a given model add 'has_muck_blog'
  class User < ActiveRecord::Base
    has_muck_blog
  end
For each model that 'has_muck_blog' you will need to setup routing.  For a user model this would be:
  map.resources :users do |users|
    users.resource :blog, :controller => 'muck/blogs' do |blogs|
      blogs.resources :posts, :controller => 'muck/posts'
    end
  end
  
Copyright (c) 2009 Muck Your App, released under the MIT license

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
muck-blogs-0.1.7 README.rdoc
muck-blogs-0.1.6 README.rdoc
muck-blogs-0.1.5 README.rdoc
muck-blogs-0.1.4 README.rdoc
muck-blogs-0.1.1 README.rdoc
muck-blogs-0.1.2 README.rdoc
muck-blogs-0.1.3 README.rdoc
muck-blogs-0.1.0 README.rdoc