Add flash type error.Rewrite controllers to use common flash style with redirect_to

This commit is contained in:
Nishanth Vijayan 2016-03-10 14:25:38 +05:30
parent dcdceb7c6d
commit 434eb90b76
16 changed files with 81 additions and 85 deletions

View file

@ -28,8 +28,8 @@ module Users
openid.save!
sign_in user
flash[:notice] = "#{user.email} signed in successfully with #{provider}"
redirect_to request.env['omniauth.origin'] || root_path
redirect_to request.env['omniauth.origin'] || root_path,
notice: "#{user.email} signed in successfully with #{provider}"
rescue => e
flash[:error] = e.message
redirect_back_or_to new_user_registration_path