adds i18n to debates' interface
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user