clarion/app/controllers/management/events_controller.rb
2014-10-10 20:25:41 +03:00

48 lines
1.1 KiB
Ruby

module Management
class EventsController < ManagementController
before_action :assign_suggestion, only: [:show, :state]
def index
@suggestion_groups = SuggestionGroup.for_conference Conference.current
end
def approved
@suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:approved]
render :index
end
def undecided
@suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:undecided]
render :index
end
def rejected
@suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:rejected]
render :index
end
def backup
@suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:backup]
render :index
end
def show
end
def state
@suggestion.state = state_params
@suggestion.save
end
private
def state_params
params.require :state
end
def assign_suggestion
@suggestion = Event.find params[:id]
end
end
end