Canyon
Canyon is a Rails blogging engine, it is build to get included in another Rails application. Read more about how Rails engines work here. It includes the admin section to create and update blog posts and to manage authors. How you use and present the blog posts is up to your main Rails application.
You can add Canyon to a new Rails application or an existing one.
Installation
Include the engine to your projects Gemfile.
# Gemfile
gem 'canyon'
Include the routes from the engine to your applications routing file. What path you use for the admin section is up to you. In this example it is: cy-admin
# config/routes.rb
Rails.application.routes.draw do
# All your application routes.
mount Canyon::Engine => '/cy-admin'
end
Load the engine sample data. (optional)
# db/seeds.rb
Canyon::Engine.load_seed
Running rake db:seed
will now include a default user and blog post from the engines seed file.
Configure
You can override any of the following defaults.
# config/initializers/canyon.rb
Canyon.configure do |config|
config.display_summary_field = false
config.display_language_field = false
end
Usage
To access published posts, use the following code in your e.g. controllers.
Canyon::Post.published
# => ActiveRecord::Relation object to access published posts.