Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OmniAuth Action Controller Error
- class AuthenticationsController < ApplicationController
- def index
- @authentications = current_user.authentications if current_user
- end
- def create
- auth = request.env["omniauth.auth"]
- current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'],auth['uid'])
- flash[:notice] = "Authentication successful."
- redirect_to authentications_url
- end
- def destroy
- @authentication = current_user.authentications.find(params[:id])
- @authentication.destroy
- flash[:notice] = "Successfully destroyed authentication."
- redirect_to authentications_url
- end
- ProjectManage::Application.routes.draw do |map|
- match '/auth/:provider/callback' => 'authentications#create'
- devise_for :users
- resources :projects
- resources :tasks
- resources :authentications # <-- This is the one you're missing
- root :to => 'projects#index'
- end
Add Comment
Please, Sign In to add comment