Class: Calagator::AdminController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Calagator::AdminController
- Defined in:
- app/controllers/calagator/admin_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#events ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/calagator/admin_controller.rb', line 9 def events if params[:query].blank? @events = Event.future else @search = Event::Search.new(params) @admin_query = params[:query] @events = @search.events flash[:failure] = @search. return redirect_to admin_events_path if @search.hard_failure? end render 'calagator/admin/events' end |
#index ⇒ Object
7 |
# File 'app/controllers/calagator/admin_controller.rb', line 7 def index; end |
#lock_event ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/calagator/admin_controller.rb', line 25 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, query: params[:query] end |