Sha256: 44e960ba1df274b0e354f8e3ba8f666d258ef37edeeec2fff916a1a650b33b5e

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

module Calagator

class AdminController < Calagator::ApplicationController
  require_admin

  def index
  end

  def events
    @events = Event.future
  end

  def lock_event
    @event = Event.find(params[:event_id])
    if @event.locked?
      @event.unlock_editing!
      flash[:success] = "Unlocked event #{@event.title} (#{@event.id})"
    else
      @event.lock_editing!
      flash[:success] = "Locked event #{@event.title} (#{@event.id})"
    end
    redirect_to :action => :events
  end

end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
calagator-1.0.0.rc2 app/controllers/calagator/admin_controller.rb
calagator-1.0.0.rc1 app/controllers/calagator/admin_controller.rb