A mountable Rails blogging engine.
Add this line to your application's Gemfile:
gem 'boring_science'
And then execute:
$ bundle
Copy migrations to your application and migrate:
$ rails boring_science:install:migrations
$ rails db:migrate
Add a blog to your applications routes:
# config/routes.rb
Rails.application.routes.draw do
# ...
# Default Blog
mount BoringScience.blog, at: '/blog'
# Second Blog
mount BoringScience.blog, at: '/other',
as: :other_blog,
options: { title: 'Other Blog', blog: 'other' }
end
Define a blogging user (can be nil for read only access):
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
# ...
def boring_science_user
current_user
end
end
Pull requests welcome.
The gem is available as open source under the terms of the MIT License.