fixed reactivating teams in a contest failed

This commit is contained in:
Absurdon 2017-03-08 20:31:10 +01:00
parent 9989e840aa
commit b1e451030c
2 changed files with 3 additions and 3 deletions

View file

@ -26,11 +26,11 @@ class ContestersController < ApplicationController
@contester.score = @contester.contest.contesters.active.count + 1 @contester.score = @contester.contest.contesters.active.count + 1
end end
if @contester.save if @contester.save!
flash[:notice] = t(:contests_join) flash[:notice] = t(:contests_join)
redirect_to contest_path(@contester.contest_id) redirect_to contest_path(@contester.contest_id)
else 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 redirect_to_back
end end
end end

View file

@ -177,7 +177,7 @@
<%= form_for contester do |c| %> <%= form_for contester do |c| %>
<%= c.hidden_field :active, { value: 1 } %> <%= c.hidden_field :active, { value: 1 } %>
<%= link_to icon('pencil'), edit_contester_path(contester) %> <%= 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 %>
<% end %> <% end %>
</td> </td>