Add feedback when voting

This commit is contained in:
ricola 2026-01-09 15:35:33 -06:00
parent a93ae1269b
commit da30b02405
3 changed files with 16 additions and 2 deletions

View file

@ -510,15 +510,15 @@ post '/votes/:id/ratings' do
end
if not @errors.empty?
@params = params
erb :votes_show_open
else
@vote.candidates.each do |candidate|
rating = Rating.find_or_initialize_by(vote: @vote, user: current_user, candidate: candidate)
rating.value = params[candidate.id.to_s]
rating.save
end
redirect '/votes/' + @vote.secure_id
@voted = true
end
erb :votes_show_open
end
get '/votes/:id/organizers' do