I create application using rails4 with devise and omniauth am trying facebook integration. Am login with facebook initially its login and authenticated the credential, after the callback its redirect to my application and through's
Routing error: uninitialized constant Users::OmniauthCallbacksController
i show my code related to devise fb
config/intializers/devise.rb
require "omniauth-facebook"
config.secret_key = 'ef8c3900aebe5cc02feb1dfafb084b2ed35412b43b9424315ac192336f3d16389449739f9a4d451621a912be899af0b9d1ce66fde56487e7edda30ba3997a2cd'
config.omniauth :facebook, '############', '######################', :strategy_class => OmniAuth::Strategies::Facebook
config/routes.rb devise_for :users, controllers: {omniauth_callbacks: "users/omniauth_callbacks"}
devise_scope :user do
get 'sign_in', :to => 'devise/sessions#new'
get 'sign_out', :to => 'devise/sessions#destroy'
root to: "devise/sessions#new"
end
and my view/layout/application.html.erb (for fb script)
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '##########', // App ID from the app dashboard
channelUrl : 'http://localhost:3000/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Additional initialization code such as adding Event Listeners goes here
};
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
i tried many times but am getting the same error plz give your valuable solutions for this issue
Thanks in advance.