Add the gem to your Gemfile:
gem 'thredded'
Add an initializer to your app: config/initializers/thredded.rb
Thredded.user_class = 'User'
Thredded.email_incoming_host = 'incoming.example.com'
Thredded.email_from = '[email protected]'
Thredded.email_outgoing_prefix = '[Thredded] '
Copy the migrations over to your parent application and migrate:
rake thredded:install:migrations db:migrate db:test:prepare
Mount the thredded engine in your routes file:
mount Thredded::Engine => '/forum'
Add rails-4 friendly "friendly_id" to your gem file
gem 'friendly_id', github: 'norman/friendly_id'
There are a few things you need in your app to get things looking just right.
- Add a to_s method to your user model. The following example assumes a column in my user model called
name
:
- name also seems to be required via (messageboards/index latest_user_for(messageboard) -> messageboard.topics.first.last_user.name)
class User < ActiveRecord::Base
def to_s
name
end
end
For more information see the full-fledged rails app
- Navigate to your mount location /new to create a new messageboard
- need to explain options here (logged in vs. members)
- messageboard should be letters,numbers,dash and underscore only and 1-16 characters