summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorTomer Kimia <tkimia@purdue.edu>2014-03-04 19:51:46 -0500
committerTomer Kimia <tkimia@purdue.edu>2014-03-04 19:51:46 -0500
commitd73a82b74685df29eb37c1a8b250951827dc164b (patch)
treee9fc3e56cc60e4262f4870e834b7dbc5f13e31d2 /app/controllers
parent7ea754bef9e07405a86ce3fc9b0597fef3c1aa35 (diff)
parent6db29eb669a85e5b0aac7a1e8879781a1cb77772 (diff)
I REALLY hope I'm not overwriting anything
Merge branch 'master' of https://github.com/LukeShu/leaguer Conflicts: app/assets/stylesheets/custom.css.scss
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sessions_controller.rb10
-rw-r--r--app/controllers/tournaments_controller.rb9
2 files changed, 7 insertions, 12 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 25af8a1..9e539ac 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -13,12 +13,12 @@ class SessionsController < ApplicationController
respond_to do |format|
if @user && @user.authenticate(params[:session][:password])
sign_in @user
- format.html { redirect_to root_path }
+ format.html { redirect_to root_path }
else
- format.html { render action: 'new' }
- format.json { render json: @user.errors, status: :unprocessable_entity }
- end
- end
+ format.html { render action: 'new' }
+ format.json { render json: @user.errors, status: :unprocessable_entity }
+ end
+ end
end
# DELETE /sessions/current
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 27ba020..5c53693 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -15,6 +15,7 @@ class TournamentsController < ApplicationController
# GET /tournaments/new
def new
@game_names = Game.all.collect
+ @game = params[:game]
@tournament = Tournament.new
end
@@ -22,12 +23,6 @@ class TournamentsController < ApplicationController
def edit
end
- def selected
- render :update do |page|
- page.replace_html 'ajax-form', :partial => 'selected'
- end
- end
-
# POST /tournaments
# POST /tournaments.json
def create
@@ -76,6 +71,6 @@ class TournamentsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def tournament_params
- params.require(:tournament).permit(:game_id)
+ params.require(:tournament).permit(:game_id, :game)
end
end