Skip to content
✒️📛 whitelabel your application
Latest commit fa5cf1f May 5, 2015 @phoet code highlighting
Failed to load latest commit information.
lib bump version Jan 29, 2015
spec gc -am "use rspec 3" Jan 29, 2015
.document initial commit Jun 7, 2012
.gitignore add gitingnore Jun 7, 2012
.rspec add reset! and improve errors when no label set Sep 23, 2012
.ruby-version add ruby 2.2.0 Jan 29, 2015
.travis.yml no ree Jan 29, 2015
Gemfile initial commit Jun 7, 2012
Gemfile.lock bump version Jan 29, 2015 code highlighting May 5, 2015
Rakefile initial commit Jun 7, 2012
whitelabel.gemspec fix the umlaut Jan 29, 2015


This gem helps you providing whitelabel functionality in your application.


Add this line to your application's Gemfile:

gem 'whitelabel'

And then execute:

bundle install

Or install it yourself as:

gem install whitelabel


You can start with a pretty simple, file driven whitelabel configuration.

All you need is a config file:

# config/whitelabel.yaml
- !ruby/struct:YourLabelClass
  label_id: "white"
  some_config: "for your application"

and an initializer:

# config/initializers/whitelabel.rb
YourLabelClass = :label_id, :some_config
Whitelabel.from_file Rails.root.join("config/whitelabel.yml")

Whitelabel works the same way I18n does, just set it up in your ApplicationController:

    # app/controllers/application_controller.rb
    before_filter :switch_label

    def switch_label
      unless Whitelabel.label_for(request.subdomains.first)
        redirect_to(labels_url(subdomain: false), alert: "Please select a Label!")

This example uses the subdomain to determine which label should be active, but you can implement whatever you like here.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.