Sha256: 18d26a93d7036d07af3b8034d85f340c8bcefa1c6a10cc8b2cbc993b23aaf7ac

Contents?: true

Size: 891 Bytes

Versions: 47

Compression:

Stored size: 891 Bytes

Contents

module ActiveMetadata
  class WatchersController < ApplicationController
    unloadable

    def index
      @document = eval(params[:model_name]).find params[:model_id]

      @watchers = @document.watchers_for params[:field_name]

      respond_to do |format|
        format.html { render :layout => false}
        format.xml  { render :xml => @watchers }
      end
    end

    def create
      @document = eval(params[:model_name]).find params[:model_id]     
      @document.create_watcher_for params[:field_name], User.find(params[:user_id])

      respond_to do |format|
        format.js       
      end
    end       
    
    def destroy
      @document = eval(params[:model_name]).find params[:model_id]     
      @document.delete_watcher_for params[:field_name], User.find(params[:user_id])
      respond_to do |format|
        format.js       
      end
    end
    
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
active_metadata-0.3.0 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.2.4 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.2.3 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.2.2 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.2.1 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.2.0 app/controllers/active_metadata/watchers_controller.rb
active_metadata-0.1.9 app/controllers/active_metadata/watchers_controller.rb