Skip to content

Latest commit

 

History

History
75 lines (62 loc) · 2.29 KB

README.md

File metadata and controls

75 lines (62 loc) · 2.29 KB

Setup

Create a new project '''rails g your-project-name'''

Include navel_gazer in the Gemfile

  gem 'omniauth-identity'
  gem 'omniauth-instagram'
  gem 'omniauth-twitter', '0.0.8'
  gem 'omniauth-banters', :git => "git://github.com/becarella/omniauth-banters.git"

  gem 'handlebars_wax', :git => "git://github.com/goggin13/handlebars_wax.git"

  gem "render_or_redirect", :git => '[email protected]:becarella/render_or_redirect.git'
  gem 'let_me_in', :git => '[email protected]:becarella/let_me_in.git'
  gem 'navel_gazer', :git => '[email protected]:becarella/navel_gazer.git'

Register api keys for:

Store the keys in environment variables. On localhost, edit .bash_profile:

  export BANTERS_KEY="xyz"
  export BANTERS_SECRET="abc"
  export TWITTER_KEY="xyz"
  export TWITTER_SECRET="abc"
  export INSTAGRAM_KEY="xyz"
  export INSTAGRAM_SECRET="abc"
  export EMBEDLY_KEY="whatevs"

To host on heroku, register a new application and install the keys. https://devcenter.heroku.com/articles/config-vars

  heroku config:add BANTERS_KEY=xyz
  ...

Install the database migrations into your projects:

  rake let_me_in_engine:install:migrations
  rake navel_gazer_engine:install:migrations
  rake db:migrate

Add these routes to routes.rb

  root :to => 'navel_gazer/posts#index'
  match 'posts' => 'navel_gazer/posts#index'
  match 'signin' => 'let_me_in/sessions#new'
  match 'signout' => 'let_me_in/sessions#destroy'
  match 'auth/:provider/connect' => "let_me_in/auth#connect", :via => :get
  match 'auth/:provider/:id' => 'let_me_in/auth#disconnect', :via => :delete
  match 'auth/:provider/callback' => 'let_me_in/auth#callback'
  match 'auth(/:provider)/failure' => 'let_me_in/auth#failure'
  match 'accounts' => 'let_me_in/linked_accounts#index', :as => 'accounts'
  match 'accounts' => 'let_me_in/linked_accounts#index', :as => 'post_login'

Create the file app/models/user.rb:

  class User & NavelGazer::User
  
  end

Run rails c and do:

  User.create(:username=>'USERNAME', :email=>'EMAIL', :password=>'PASSWORD', :password_confirmation=>'PASSWORD')