Git Product home page Git Product logo

shogun_rails's Introduction

Shogun

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

Advanced configuration options

automount

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 => '/'

layout

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"

Manually setting site_id and secret_token

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.

shogun_rails's People

Contributors

finbarr avatar markdillon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.