Sha256: c6e7377a08061d838dcfb3263ca66d8f772589b638f5ef797681e7f12e732fae
Contents?: true
Size: 975 Bytes
Versions: 13
Compression:
Stored size: 975 Bytes
Contents
class Commontator::SubscriptionsController < Commontator::ApplicationController before_action :set_thread # PUT /threads/1/subscribe def subscribe security_transgression_unless @commontator_thread.can_subscribe?(@commontator_user) @commontator_thread.errors.add(:base, t('commontator.subscription.errors.already_subscribed')) \ unless @commontator_thread.subscribe(@commontator_user) respond_to do |format| format.html { redirect_to commontable_url } format.js { render :subscribe } end end # PUT /threads/1/unsubscribe def unsubscribe security_transgression_unless @commontator_thread.can_subscribe?(@commontator_user) @commontator_thread.errors.add(:base, t('commontator.subscription.errors.not_subscribed')) \ unless @commontator_thread.unsubscribe(@commontator_user) respond_to do |format| format.html { redirect_to commontable_url } format.js { render :subscribe } end end end
Version data entries
13 entries across 13 versions & 1 rubygems