login: add /login & /logout routes, rename 'sign in' to 'login'.

* Replace /session/new with /login and /session/sign_out with /logout.
* Rename 'sign in' to 'login'.

This changes are to make urls cleaner and terminology more consistent.
This commit is contained in:
evazion
2019-12-14 15:20:11 -06:00
parent 7f08300f56
commit 48e0569832
10 changed files with 15 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ class UsersController < ApplicationController
@user = CurrentUser.user
if @user.is_anonymous?
redirect_to new_session_path
redirect_to login_path(url: settings_path)
else
params[:action] = "edit"
respond_with(@user, template: "users/edit")
@@ -54,7 +54,7 @@ class UsersController < ApplicationController
params[:action] = "show"
respond_with(@user, methods: @user.full_attributes, template: "users/show")
elsif request.format.html?
redirect_to new_session_path
redirect_to login_path(url: profile_path)
else
raise ActiveRecord::RecordNotFound
end