From b40cccf2aa5d1250018291e82ac4169211e425f3 Mon Sep 17 00:00:00 2001 From: "Matthew F. Short" Date: Mon, 2 Nov 2015 12:41:48 -0500 Subject: [PATCH] changes --- app/assets/javascripts/angular/app.js | 1 + app/controllers/application_controller.rb | 4 ++++ app/controllers/session_controller.rb | 2 +- app/views/home.html.erb | 4 ++++ app/views/layouts/angular.html.erb | 13 +++++++++++++ app/views/layouts/application.html.erb | 18 ------------------ app/views/welcome.html.erb | 17 +++++++++++++++++ config/initializers/assets.rb | 2 +- config/routes.rb | 2 ++ 9 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 app/assets/javascripts/angular/app.js create mode 100644 app/views/home.html.erb create mode 100644 app/views/layouts/angular.html.erb diff --git a/app/assets/javascripts/angular/app.js b/app/assets/javascripts/angular/app.js new file mode 100644 index 0000000..d3cf0bb --- /dev/null +++ b/app/assets/javascripts/angular/app.js @@ -0,0 +1 @@ +alert("I'm home") diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8397cd7..49d0b8a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,6 +9,10 @@ class ApplicationController < ActionController::Base render '/welcome' end + def home + render '/home', layout: "angular" + end + private def current_user diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index 1699048..476491b 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -17,7 +17,7 @@ class SessionController < ApplicationController flash[:message] = "Email / Password combo does not exist!" end - redirect_to root_path + redirect_to application_home_path end def destroy diff --git a/app/views/home.html.erb b/app/views/home.html.erb new file mode 100644 index 0000000..4e6778f --- /dev/null +++ b/app/views/home.html.erb @@ -0,0 +1,4 @@ + +

Angular Is AWESOME

+ +<%= javascript_include_tag 'angular/app.js' %> diff --git a/app/views/layouts/angular.html.erb b/app/views/layouts/angular.html.erb new file mode 100644 index 0000000..3a404c2 --- /dev/null +++ b/app/views/layouts/angular.html.erb @@ -0,0 +1,13 @@ + + + + TheSinsWeCommit + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + + <%= yield %> + + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 340ec71..0eb9616 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,24 +7,6 @@ <%= csrf_meta_tags %> - <%= render partial: 'layouts/header' %> - - <% if flash[:message] %> -
- <%= flash[:message] %> -
- <% end %> - <%= yield %> - - <% if current_user %> -
-
- - - -
- <% end %> diff --git a/app/views/welcome.html.erb b/app/views/welcome.html.erb index a012094..8575afe 100644 --- a/app/views/welcome.html.erb +++ b/app/views/welcome.html.erb @@ -1,3 +1,10 @@ +<%= render partial: 'layouts/header' %> +<% if flash[:message] %> +
+ <%= flash[:message] %> +
+<% end %> +

Welcome, sinner

Please sign up to lift your burdens

@@ -27,3 +34,13 @@ placeholder="desired password">
+ +<% if current_user %> +
+
+ + + +
+<% end %> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 88c82b0..feaefc2 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -8,4 +8,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -Rails.application.config.assets.precompile += %w( login_signup.js ) +Rails.application.config.assets.precompile += %w( login_signup.js angular/app.js ) diff --git a/config/routes.rb b/config/routes.rb index ebdc12a..c28f43d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ Rails.application.routes.draw do root 'application#welcome' + get 'application/home' #, to: 'application#home', as: :application_home + resources :transgressions, only: [:index, :create], defaults: { format: :json } do resources :confessions, only: [:create], shallow: true end