summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-03-02 15:59:50 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-03-02 15:59:50 -0500
commit7d84062ebe272855c0e6ebbfd991ab277fdc079f (patch)
treeb7e435021aeb4a78f1e1798556e52c6f1f9c2857
parent0d3a1f6030eec5631892ec733ec75001bfe2f9ff (diff)
currently adding Session controller and view
-rw-r--r--Gemfile.lock8
-rw-r--r--app/controllers/application_controller.rb4
-rw-r--r--app/views/layouts/application.html.erb29
-rw-r--r--config/routes.rb72
-rwxr-xr-xgenerate.sh1
5 files changed, 45 insertions, 69 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 9de990e..9dd0199 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -26,11 +26,7 @@ GEM
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
-<<<<<<< HEAD
atomic (1.1.15)
-=======
- atomic (1.1.14)
->>>>>>> 699bd065c06689a159c11ac3aacef6b34001617c
bcrypt-ruby (3.1.2)
bootstrap-sass (3.1.1.0)
sass (~> 3.2)
@@ -119,11 +115,7 @@ GEM
multi_json (~> 1.0)
rubyzip (< 1.0.0)
websocket (~> 1.0.4)
-<<<<<<< HEAD
sprockets (2.11.0)
-=======
- sprockets (2.10.1)
->>>>>>> 699bd065c06689a159c11ac3aacef6b34001617c
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index d83690e..03ef797 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,4 +2,8 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ #include sessionhelper for the session controller and view
+ include SessionHelper
+
end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
deleted file mode 100644
index 0deede3..0000000
--- a/app/views/layouts/application.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Leaguer</title>
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-<div role="navigation" class="navbar navbar-inverse">
-<header>
- <div class="navbar-brand"> Leaguer </div>
- <div>
- <%= form_tag("/search", method: "get", :class => "navbar-form navbar-right") do %>
- <%= text_field_tag(:query, nil, :placeholder => "Search") %>
- <%= submit_tag("Go", {:class => "btn btn-warning"}) %>
- <% end %>
- </div>
-</header>
- </div>
-<%= yield %>
-
-<hr>
-<footer id="footer">
-<p> Tomer Kimia Andrew Murrell Luke Shumaker Nathaniel Foy Davis Webb Guntas Grewal </p>
-<p> The Leaguer System &#169; <%= Time.now.year %> </p> </footer>
-
-</body>
-</html>
diff --git a/config/routes.rb b/config/routes.rb
index 7d898b8..a4f1f66 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,12 @@
Leaguer::Application.routes.draw do
+
+ #creates sessions as a resource but limits it to these actions
+ resources :sessions, only: [:new, :create, :destroy]
+
+ match 'signup', to: 'users#new', via: 'get'
+ match 'signin', to: 'sessions#new', via: 'get'
+ match 'signout', to: 'sessions#destroy', via: 'delete'
+
resources :pms
resources :alerts
@@ -24,51 +32,51 @@ Leaguer::Application.routes.draw do
# root 'welcome#index'
# Example of regular route:
- # get 'products/:id' => 'catalog#view'
+ # get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
+ # resources :products
# Example resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
#
- # collection do
- # get 'sold'
- # end
- # end
+ # collection do
+ # get 'sold'
+ # end
+ # end
# Example resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
# Example resource route with more complex sub-resources:
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', on: :collection
- # end
- # end
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', on: :collection
+ # end
+ # end
# Example resource route with concerns:
- # concern :toggleable do
- # post 'toggle'
- # end
- # resources :posts, concerns: :toggleable
- # resources :photos, concerns: :toggleable
+ # concern :toggleable do
+ # post 'toggle'
+ # end
+ # resources :posts, concerns: :toggleable
+ # resources :photos, concerns: :toggleable
# Example resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
end
diff --git a/generate.sh b/generate.sh
index 807b9ef..7f70d56 100755
--- a/generate.sh
+++ b/generate.sh
@@ -18,6 +18,7 @@ bundle exec rails generate scaffold tournament game:references $NOTEST
bundle exec rails generate scaffold match tournament:references $NOTEST
bundle exec rails generate scaffold team $NOTEST
bundle exec rails generate controller users $NOTEST
+bundle exec rails generate controller Sessions
bundle exec rails generate model user name:string email:string user_name:string $NOTEST
bundle exec rails generate model user_team_pair user:references team:references $NOTEST
bundle exec rails generate model team_match_pair team:references match:references $NOTEST