Sha256: 10553330b630440c4205b23b67c7e8cb6d9b0dd926537f62a73555c54e13f6b4

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require 'ixtlan/models/maintenance'
module Ixtlan
  module Guard
    module Controllers
      module MaintenanceController
        
        # GET /maintenance
        # GET /maintenance.xml
        # GET /maintenance.json
        def index
          @maintenance = ::Ixtlan::Guard::Models::Maintenance.new
          @maintenance.groups = guard.blocked_groups
          
          respond_to do |format|
            format.html # index.html.erb
            format.xml  { render :xml => @maintenance }
            format.json  { render :json => @maintenance }
          end
        end
        
        # PUT /maintenance/block
        def block
          guard.block_groups(param[:groups])
          
          respond_to do |format|
            format.html { redirect_to(maintenance_url) }
            format.xml  { head :ok }
            format.json  { head :ok }
          end
        end
        
        # PUT /maintenance/resume
        def resume
          guard.block_groups([])
          
          respond_to do |format|
            format.html { redirect_to(maintenance_url) }
            format.xml  { head :ok }
            format.json  { head :ok }
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ixtlan-guard-0.7.0 lib/ixtlan/guard/controllers/maintenance_controller.rb
ixtlan-guard-0.6.1 lib/ixtlan/guard/controllers/maintenance_controller.rb
ixtlan-guard-0.6.0 lib/ixtlan/guard/controllers/maintenance_controller.rb
ixtlan-guard-0.5.0 lib/ixtlan/guard/controllers/maintenance_controller.rb
ixtlan-guard-0.4.1 lib/ixtlan/guard/controllers/maintenance_controller.rb
ixtlan-guard-0.4.0 lib/ixtlan/guard/controllers/maintenance_controller.rb