Add Shogun to your Gemfile:
# Gemfile
gem 'shogun', github: 'getshogun/shogun_rails'
Run bundle install
Sign up and find your environment variables in settings. Add these to your env:
SHOGUN_SITE_ID={your site id}
SHOGUN_SECRET_TOKEN={your secret token}
If you are using Unicorn, you also need to add this line in your after_fork
configuration block:
Shogun.daemon.call
Full example:
# config/unicorn.rb
after_fork do
...
Shogun.daemon.call
...
end
Shogun will automatically mount itself in your routes
. You can disable this functionality and manually mount shogun by creating an initializer:
# config/initializers/shogun.rb
Shogun.automount = false
You will then need to mount Shogun manually in your config/routes.rb
file:
# config/routes.rb
mount Shogun::Engine => '/'
Shogun will use your application
layout by default. You can override this with the name of another layout:
# config/initializers/shogun.rb
Shogun.layout = "my_special_layout"
If you name your environment variables appropriately, these are picked up automatically by Shogun. These can also be set manually:
# config/initializers/shogun.rb
Shogun.site_id = "the_site_id"
Shogun.secret_token = "the_secret_token"
This project rocks and uses MIT-LICENSE.