A Rails Engine for BBS(Bulletin Board System).
Add this line to your application's Gemfile:
gem 'bbs'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bbs
$ bin/rails bbs:install:migrations
Edit config/routes.rb
:
Rails.application.routes.draw do
mount Bbs::Engine => '/bbs' # choose your mount point arbitrarily
end
$ bin/rails g bbs:config
Execute the above command will copy following files into your
config/initializers
.
- config/initializers/bbs.rb
- config/locales/bbs.ja.yml
- config/locales/bbs.en.yml
$ rails g active_record:bbs User
Execute the above command will generate models(User, UserProfile and Avatar) and its migrations.
Uncomment bbs config and specify user model name arbitrary.
config.user_class = 'User'
Component that list all categories. In view, you have to call the cell object:
= cell('bbs/category')
Component that list latest topics. In view, you have to call the cell object:
= cell('bbs/latest_topics')
To change the number of displayed topics, change the value config.latest_topics_count
in config/initializers/bbs.rb
(The default is 10).
If you want to customize bbs views, you can copy view templates provided by this gem using generator.
$ bin/rails g bbs:views
Execute the above command will copy view templates to app/views/bbs/
.
- Fork it ( http://github.com/bm-sms/bbs )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
The gem is available as open source under the terms of the MIT License.