forked from fixin.me/fixin.me
Separate root routes for un- and authenticated users
Closes #34 Closes #47
This commit is contained in:
parent
8b1a186467
commit
b8bcbee1e9
@ -31,18 +31,6 @@ class ApplicationController < ActionController::Base
|
|||||||
session[:revert_to_id].present?
|
session[:revert_to_id].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_in_path_for(scope)
|
|
||||||
if current_user.at_least(:admin)
|
|
||||||
users_path
|
|
||||||
else
|
|
||||||
edit_user_registration_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_sign_out_path_for(scope)
|
|
||||||
new_user_session_path
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
attr_reader :navigation_menu_tab
|
attr_reader :navigation_menu_tab
|
||||||
def navigation_tab(name)
|
def navigation_tab(name)
|
||||||
|
@ -18,9 +18,12 @@ Rails.application.routes.draw do
|
|||||||
collection { get :revert }
|
collection { get :revert }
|
||||||
end
|
end
|
||||||
|
|
||||||
devise_scope :user do
|
unauthenticated do
|
||||||
root to: "devise/sessions#new"
|
as :user do
|
||||||
|
root to: 'devise/sessions#new'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
root to: 'units#index', as: :user_root
|
||||||
|
|
||||||
direct(:source_code) { "https://gitea.michalczyk.pro/fixin.me/fixin.me" }
|
direct(:source_code) { "https://gitea.michalczyk.pro/fixin.me/fixin.me" }
|
||||||
direct(:issue_tracker) { "https://gitea.michalczyk.pro/fixin.me/fixin.me/issues" }
|
direct(:issue_tracker) { "https://gitea.michalczyk.pro/fixin.me/fixin.me/issues" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user