app/controllers/application_controller.rb
# Sets where Devise should redirect on sign-in.
Sets where Devise should redirect on sign-in.
Sets where Devise should redirect on sign - in .
def after_sign_in_path_for (resource_or_scope)
    path = session[:user_return_to] || localized_root_url
    url_param = (I18n.locale == I18n.default_locale) ? '' : I18n.locale
    url_param.present? ?
        path.gsub(/:locale\/?/, "#{url_param}/") :
        path.gsub(/:locale\/?/, '')
  end
def after_sign_in_path_for ( resource_or_scope ) path = session [ :user_return_to ] || localized_root_url url_param = ( I18n . locale == I18n . default_locale ) ? '' : I18n . locale url_param . present? ? path . gsub ( / :locale \/ ? / , "#{url_param}/" ) : path . gsub ( / :locale \/ ? / , '' ) end
Sets where Devise should redirect on sign-in.
Sets where Devise should redirect on sign - in .
resource_or_scope