responds with ajax to debate vote [#47]
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
class VotesController < ApplicationController
|
||||
before_action :set_debate
|
||||
before_action :authenticate_user!
|
||||
|
||||
respond_to :html, :js
|
||||
|
||||
def create
|
||||
register_vote
|
||||
notice = @debate.vote_registered? ? I18n.t("votes.notice_thanks") : I18n.t("votes.notice_already_registered")
|
||||
redirect_to @debate, notice: notice
|
||||
respond_with @debate
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user