From b1e451030ca03b33c7cc87b9ea3bdbc01ab7b85f Mon Sep 17 00:00:00 2001 From: Absurdon Date: Wed, 8 Mar 2017 20:31:10 +0100 Subject: [PATCH] fixed reactivating teams in a contest failed --- app/controllers/contesters_controller.rb | 4 ++-- app/views/contests/edit.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/contesters_controller.rb b/app/controllers/contesters_controller.rb index 5c8f376..115ca3f 100644 --- a/app/controllers/contesters_controller.rb +++ b/app/controllers/contesters_controller.rb @@ -26,11 +26,11 @@ class ContestersController < ApplicationController @contester.score = @contester.contest.contesters.active.count + 1 end - if @contester.save + if @contester.save! flash[:notice] = t(:contests_join) redirect_to contest_path(@contester.contest_id) else - flash[:error] = t(:errors) + @contester.errors.full_messages.to_s + flash[:error] = @contester.errors.full_messages.to_s #t(:errors) + @contester.errors.full_messages.to_s redirect_to_back end end diff --git a/app/views/contests/edit.html.erb b/app/views/contests/edit.html.erb index ea4e40c..bee8782 100644 --- a/app/views/contests/edit.html.erb +++ b/app/views/contests/edit.html.erb @@ -177,7 +177,7 @@ <%= form_for contester do |c| %> <%= c.hidden_field :active, { value: 1 } %> <%= link_to icon('pencil'), edit_contester_path(contester) %> - <%= link_to_function icon('rotate-left'), "$('edit_contester_#{contester.id}').submit()" %> + <%= link_to_function icon('rotate-left'), "$('#edit_contester_#{contester.id}').submit()" %> <% end %> <% end %>