clarion/app/controllers/management/events_controller.rb

43 lines
959 B
Ruby
Raw Normal View History

module Management
class EventsController < ManagementController
2014-10-10 19:10:34 +03:00
before_action :assign_suggestion, only: [:show, :state]
def index
@suggestion_groups = SuggestionGroup.for_conference Conference.current
end
2014-10-10 19:10:34 +03:00
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 show
end
2014-10-10 19:10:34 +03:00
def state
@suggestion.state = state_params
@suggestion.save
end
private
2014-10-10 19:10:34 +03:00
def state_params
params.require :state
end
def assign_suggestion
@suggestion = Event.find params[:id]
end
end
end