diff options
author | Tomer Kimia <tkimia@purdue.edu> | 2014-03-02 16:37:22 -0500 |
---|---|---|
committer | Tomer Kimia <tkimia@purdue.edu> | 2014-03-02 16:37:22 -0500 |
commit | 8f0fcea67d457ec232edfc30d8a4de7355a0c530 (patch) | |
tree | 5db221a82ea315d202018c2b37c851ab2965bd20 | |
parent | ef3f0fa6ea34f3c9fbbc67ac14abed983838d281 (diff) | |
parent | 7d84062ebe272855c0e6ebbfd991ab277fdc079f (diff) |
app html still here
-rw-r--r-- | Gemfile.lock | 10 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/users_controller.rb | 3 | ||||
-rw-r--r-- | config/application.rb | 2 | ||||
-rw-r--r-- | config/routes.rb | 72 | ||||
-rwxr-xr-x | generate.sh | 1 | ||||
-rw-r--r-- | log/.keep | 0 | ||||
-rw-r--r-- | test/controllers/.keep | 0 | ||||
-rw-r--r-- | test/fixtures/.keep | 0 | ||||
-rw-r--r-- | test/helpers/.keep | 0 | ||||
-rw-r--r-- | test/integration/.keep | 0 | ||||
-rw-r--r-- | test/mailers/.keep | 0 | ||||
-rw-r--r-- | test/models/.keep | 0 | ||||
-rw-r--r-- | test/test_helper.rb | 15 |
14 files changed, 55 insertions, 52 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index b47c41e..9dd0199 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,7 +26,7 @@ GEM thread_safe (~> 0.1) tzinfo (~> 0.3.37) arel (4.0.2) - atomic (1.1.14) + atomic (1.1.15) bcrypt-ruby (3.1.2) bootstrap-sass (3.1.1.0) sass (~> 3.2) @@ -115,7 +115,7 @@ GEM multi_json (~> 1.0) rubyzip (< 1.0.0) websocket (~> 1.0.4) - sprockets (2.10.1) + sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -124,13 +124,13 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) - sqlite3 (1.3.8) + sqlite3 (1.3.9) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref thor (0.18.1) - thread_safe (0.1.3) - atomic + thread_safe (0.2.0) + atomic (>= 1.1.7, < 2) tilt (1.4.1) treetop (1.4.15) polyglot 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/controllers/users_controller.rb b/app/controllers/users_controller.rb index ebcc3ac..f4e1499 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,4 +3,7 @@ class UsersController < ApplicationController def new end + def show + @user = User.find(param[:id]) + end end diff --git a/config/application.rb b/config/application.rb index bf581b8..57c9163 100644 --- a/config/application.rb +++ b/config/application.rb @@ -12,6 +12,8 @@ module Leaguer # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + I18n.enforce_available_locales = true + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' 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 diff --git a/log/.keep b/log/.keep deleted file mode 100644 index e69de29..0000000 --- a/log/.keep +++ /dev/null diff --git a/test/controllers/.keep b/test/controllers/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/controllers/.keep +++ /dev/null diff --git a/test/fixtures/.keep b/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/fixtures/.keep +++ /dev/null diff --git a/test/helpers/.keep b/test/helpers/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/helpers/.keep +++ /dev/null diff --git a/test/integration/.keep b/test/integration/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/integration/.keep +++ /dev/null diff --git a/test/mailers/.keep b/test/mailers/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/mailers/.keep +++ /dev/null diff --git a/test/models/.keep b/test/models/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/models/.keep +++ /dev/null diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index bc7e05d..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -ENV["RAILS_ENV"] ||= "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - ActiveRecord::Migration.check_pending! - - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end |