From 319a215246a58b75cc33f5ce82af6da0e27e412d Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 3 Nov 2015 10:20:16 -0500 Subject: [PATCH] redirecting to angular files when logged in --- app/controllers/application_controller.rb | 4 ++++ app/controllers/session_controller.rb | 1 + app/views/angular.html.erb | 1 + config/routes.rb | 2 ++ 4 files changed, 8 insertions(+) create mode 100644 app/views/angular.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8397cd7..4abcc52 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -5,6 +5,10 @@ class ApplicationController < ActionController::Base helper_method :current_user + def angular + render '/angular' + end + def welcome render '/welcome' end diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index 1699048..a94a74e 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -13,6 +13,7 @@ class SessionController < ApplicationController user.update(session_token: token) flash[:message] = "Thanks for logging in, sinner." + redirect_to application_angular_path else flash[:message] = "Email / Password combo does not exist!" end diff --git a/app/views/angular.html.erb b/app/views/angular.html.erb new file mode 100644 index 0000000..2918a56 --- /dev/null +++ b/app/views/angular.html.erb @@ -0,0 +1 @@ +oh hai! diff --git a/config/routes.rb b/config/routes.rb index ebdc12a..6a6308e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ Rails.application.routes.draw do root 'application#welcome' + get 'application/angular' + resources :transgressions, only: [:index, :create], defaults: { format: :json } do resources :confessions, only: [:create], shallow: true end