2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-13 14:37:05 +03:00
|
|
|
class SocialEventsController < Admin::BaseController
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource :conference, find_by: :short_title
|
|
|
|
|
authorize_resource :social_event, through: :conference
|
2013-02-16 13:30:53 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def show
|
|
|
|
|
render :social_events_list
|
|
|
|
|
end
|
2013-02-16 13:30:53 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def update
|
|
|
|
|
if @conference.update_attributes(params[:conference])
|
2014-08-12 15:48:29 +03:00
|
|
|
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events were successfully updated.')
|
2014-08-06 21:14:00 +03:00
|
|
|
else
|
2014-08-12 15:48:29 +03:00
|
|
|
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.')
|
2014-08-06 21:14:00 +03:00
|
|
|
end
|
2013-02-16 13:30:53 +01:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|