Sha256: 3eb81de83224db0e033f2357628b5fa79ef29b8ec195d5c29c1149ebe9683a29
Contents?: true
Size: 684 Bytes
Versions: 8
Compression:
Stored size: 684 Bytes
Contents
class MonitorshipsController < BaseController before_filter :login_required def create @monitorship = Monitorship.find_or_initialize_by_user_id_and_topic_id(current_user.id, params[:topic_id]) @monitorship.update_attribute :active, true respond_to do |format| format.html { redirect_to forum_topic_path(params[:forum_id], params[:topic_id]) } format.js end end def destroy Monitorship.update_all ['active = ?', false], ['user_id = ? and topic_id = ?', current_user.id, params[:topic_id]] respond_to do |format| format.html { redirect_to forum_topic_path(params[:forum_id], params[:topic_id]) } format.js end end end
Version data entries
8 entries across 8 versions & 1 rubygems