There is lots of great forum software for PHP yet I’ve struggled to find great forums for Rails. With Moxieforum I set out to fix that.
This is my first plugin/gem for rails but I’m trying to take advantage of all the rails 3 goodness to make this a fantastic plugin. I want it to be effortless to install and integrate with your existing app. When MoxieForum is done, I hope the days of rewriting forum functionality for every rails app are over.
Note: this forum is a rails engine, it’s not designed to run stand-alone. Instead, it assumes you have an existing rails application, with an existing user model and a mechanism for users to register and login. If that is not the case, you may want: github.com/krschacht/moxieforum_standalone
P.S. I’ve extracted a lot of useful Rails Engine stuff for other engine builders: github.com/krschacht/rails_3_engine_demo
Technically all you need to do is “sudo gem install moxie_forum”, but I’ll walk you through the basics of integration:
Requirement: Rails v3
-
sudo gem install moxie_forum
- edit your app’s ‘Gemfile’ and add:
-
gem ‘moxie_forum’
-
rails generate moxie_forum
-
rails db:migrate
-
rails server
You can now visit: localhost:3000/forums
At this point the basic forum setup is done, you can click around, however it’s not actually integrated with your user model and authentication system yet so you won’t be able to post. To complete that:
-
Edit config/initializers/moxie_forum.rb, change :user to reflect your user model
-
Edit your ActiveRecord user model and add ‘acts_as_moxie_user’ inside the class near the top
-
Also in your user model, MoxieForum will call the following instance methods, you should override these: profile_pic, display_name, admin?, moderator?
-
#1 feature - Easy integration with your existing rails app including tight integration with your existing user model and ‘admin’ designation for users
-
Administrative interface to create multiple forums
Topics:
-
sticky
-
locked
-
merge
-
split
-
figure out how to destroy all posts in one query instead of individual
Forum:
-
allow admin-only forums