Add home page
This commit is contained in:
parent
b246c5ac70
commit
2a44d71478
|
@ -0,0 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class HomePagesController < ApplicationController
|
||||||
|
def index; end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@ class SessionsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
if @user.present? && @user.authenticate(params[:password])
|
if @user.present? && @user.authenticate(params[:password])
|
||||||
session[:user_id] = @user.id
|
session[:user_id] = @user.id
|
||||||
redirect_to @user, notice: t(".logged_in")
|
redirect_to root_path, notice: t(".logged_in")
|
||||||
else
|
else
|
||||||
flash.now.alert = t(".login_fail")
|
flash.now.alert = t(".login_fail")
|
||||||
render :new, status: :unprocessable_entity
|
render :new, status: :unprocessable_entity
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<h2>Hello, <%= current_user.full_name %></h2>
|
|
@ -3,8 +3,9 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
default_url_options :host => "summonplayer.com"
|
default_url_options :host => "summonplayer.com"
|
||||||
|
|
||||||
root "sessions#new"
|
root "home_pages#index"
|
||||||
|
|
||||||
|
# Users and sessions
|
||||||
resources :users, only: [:new, :create, :show, :edit, :update]
|
resources :users, only: [:new, :create, :show, :edit, :update]
|
||||||
resources :sessions, only: [:new, :create]
|
resources :sessions, only: [:new, :create]
|
||||||
delete "log_out", to: "sessions#destroy_session"
|
delete "log_out", to: "sessions#destroy_session"
|
||||||
|
|
Loading…
Reference in New Issue