Allow liking/unliking when JavaScript is disabled
Even if pretty much nobody uses a browser with JavaScript disabled when navigating our sites, there might be times where JavaScript isn't loaded for reasons like a slow internet connections not getting the JavaScript files or a technical issue. So we're making it possible to still use the like/unlike buttons in these cases.
This commit is contained in:
@@ -9,6 +9,7 @@ module Debates
|
||||
@debate.register_vote(current_user, params[:value])
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to request.referer, notice: I18n.t("flash.actions.create.vote") }
|
||||
format.js { render :show }
|
||||
end
|
||||
end
|
||||
@@ -17,6 +18,7 @@ module Debates
|
||||
@debate.unvote_by(current_user)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to request.referer, notice: I18n.t("flash.actions.destroy.vote") }
|
||||
format.js { render :show }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user