Compare commits

...

1 Commits

Author SHA1 Message Date
Matthew F. Short b40cccf2aa changes
10 years ago

@ -0,0 +1 @@
alert("I'm home")

@ -9,6 +9,10 @@ class ApplicationController < ActionController::Base
render '/welcome'
end
def home
render '/home', layout: "angular"
end
private
def current_user

@ -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

@ -0,0 +1,4 @@
<!-- ANGULAR STUFF -->
<h1>Angular Is AWESOME</h1>
<%= javascript_include_tag 'angular/app.js' %>

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>TheSinsWeCommit</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
</head>
<body>
<%= yield %>
</body>
</html>

@ -7,24 +7,6 @@
<%= csrf_meta_tags %>
</head>
<body>
<%= render partial: 'layouts/header' %>
<% if flash[:message] %>
<div class="alert">
<%= flash[:message] %>
</div>
<% end %>
<%= yield %>
<% if current_user %>
<hr/>
<form action="<%= session_path %>" method="POST">
<input type="hidden" name="authenticity_token"
value="<%= form_authenticity_token %>">
<input type="hidden" name="_method" value="DELETE">
<input type="submit" value="Log Out!">
</form>
<% end %>
</body>
</html>

@ -1,3 +1,10 @@
<%= render partial: 'layouts/header' %>
<% if flash[:message] %>
<div class="alert">
<%= flash[:message] %>
</div>
<% end %>
<h1>Welcome, sinner</h1>
<h3>Please sign <em>up</em> to lift your burdens</h3>
@ -27,3 +34,13 @@
placeholder="desired password"><br/>
<input type="submit" value="Sign in">
</form>
<% if current_user %>
<hr/>
<form action="<%= session_path %>" method="POST">
<input type="hidden" name="authenticity_token"
value="<%= form_authenticity_token %>">
<input type="hidden" name="_method" value="DELETE">
<input type="submit" value="Log Out!">
</form>
<% end %>

@ -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 )

@ -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

Loading…
Cancel
Save