Prattle is a Rails engine providing forum functionality. It provides basic forum, topic and post functionality to the parent application.
Prattle focuses on sensible functionality ahead of Ruby-on-Rails cleverness to deliver a forum that works rationally and looks great.
Installing prattle is simple:
gem 'prattle', :github => "lyneux/prattle"Create a prattle.rb file in config/initalizers
Prattle.user_class = "Your user class"
Prattle::ApplicationController.layout "Your layout"This allows prattle to link posts to the user who is currently logged into your application
def prattle_user
current_member
end
helper_method :prattle_user
This allows prattle to display an avatar image for your user (uses a paperclip image)
def prattle_image
image
endIf you have your own authentication scheme, you likely also have your own authorisation scheme. This method should return true if the current user is an administrator
def prattle_admin?
#Your code here. Example:
current_member.member_admin? if !current_member.nil?
endIn your parent app:
rake prattle:install:migrations
rake db:migrate