adds i18n to debates' interface

This commit is contained in:
Juanjo Bazán
2015-07-28 16:45:00 +02:00
parent d5710c8dc6
commit e9c1910d7d
10 changed files with 105 additions and 43 deletions

View File

@@ -4,7 +4,7 @@ class VotesController < ApplicationController
def create
register_vote
notice = @debate.vote_registered? ? "Gracias por votar." : "Tu voto ya ha sido registrado."
notice = @debate.vote_registered? ? I18n.t("votes.notice_thanks") : I18n.t("votes.notice_already_registered")
redirect_to @debate, notice: notice
end
@@ -12,7 +12,7 @@ class VotesController < ApplicationController
def set_debate
@debate = Debate.find(params[:debate_id])
end
end
def register_vote
@debate.vote_by voter: current_user, vote: params[:value]