Sha256: 1c07da6b12436672b28468638b714c4f6a8ac5b22df12928cf0b1ba618cf9756
Contents?: true
Size: 859 Bytes
Versions: 7
Compression:
Stored size: 859 Bytes
Contents
module Commontator class SubscriptionsController < ApplicationController before_filter :get_thread # POST /1/subscribe def create raise SecurityTransgression unless @thread.can_subscribe?(@user) @thread.errors.add(:subscription, "You are already subscribed to this thread") \ unless @thread.subscribe(@user) respond_to do |format| format.html { redirect_to @thread } format.js { render :subscribe } end end # POST /1/unsubscribe def destroy raise SecurityTransgression unless @thread.can_subscribe?(@user) @thread.errors.add(:subscription, "You are not subscribed to this thread") \ unless @thread.unsubscribe(@user) respond_to do |format| format.html { redirect_to @thread } format.js { render :subscribe } end end end end
Version data entries
7 entries across 7 versions & 1 rubygems