php - Need To redirect At home page If user Already logged in -


i using omniauth devise. controller bellow

 class omniauthcallbackscontroller < devise::omniauthcallbackscontroller       def facebook         # need implement method below in model (e.g. app/models/user.rb)         @user = user.from_omniauth(request.env["omniauth.auth"])            if @user.persisted?           sign_in_and_redirect @user, :event => :authentication #this throw if @user not activated           set_flash_message(:notice, :success, :kind => "facebook") if is_navigational_format?         else           # session["devise.facebook_data"] = request.env["omniauth.auth"]           redirect_to new_user_registration_url         end       end     end 

this redirect user signup page if user signin , persist.what make change redirect user @ home page.......????? me out please

have set after sign_in path ?

#application_controller.rb def after_sign_in_path_for(resource_or_scope)   case resource_or_scope   when :user, user      root_path   else     super   end end 

example rails devise omniauth

code example

if facing other errors please paste here


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -