tonilin / subscribem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscribem

How to use?

Create a new rails app:

$ rails new new_app --skip-test-unit -d mysql

Installing Subscribem

Add subscribem to Gemfile

gem "subscribem", :github => "tonilin/subscribem"

Run bundle install

$ bundle install

Add following line to config/routes.rb

mount Subscribem::Engine, :at => "/"

Setting Databasee

Edit config/database.yml and run rake db:create

Import subscribem schemas

$ rake railties:install:migrations

Run migrate

$ rake db:migrate

Change cookies setting

Edit /spec/dummy/config/initializers/session_store.rb, Add the domain option (Replace Dummy to your app name):

Dummy::Application.config.session_store :cookie_store, key: '_dummy_session', domain: "example.com"

Launch the app

$ powder link 
$ powder open

And then you can see a simple authentication with subdomain

Helpers

current_account to fetch current subdomain associated account.

current_user to fetch the current user.

About

License:MIT License


Languages

Language:Ruby 90.5%Language:JavaScript 5.0%Language:CSS 4.5%