2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-13 14:37:05 +03:00
|
|
|
class EmailsController < Admin::BaseController
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource :conference, find_by: :short_title
|
|
|
|
|
load_and_authorize_resource class: EmailSettings
|
2013-01-14 08:49:49 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def update
|
|
|
|
|
@conference.email_settings.update_attributes(params[:email_settings])
|
2015-10-17 16:57:48 +03:00
|
|
|
|
|
|
|
|
flash[:notice] = 'Settings have been successfully updated.'
|
|
|
|
|
redirect_to admin_conference_emails_path(@conference.short_title)
|
2014-08-06 21:14:00 +03:00
|
|
|
end
|
2013-01-14 08:49:49 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def index
|
2014-08-12 11:51:59 +03:00
|
|
|
authorize! :index, @conference.email_settings
|
2014-08-06 21:14:00 +03:00
|
|
|
@settings = @conference.email_settings
|
|
|
|
|
end
|
2013-01-14 08:49:49 +01:00
|
|
|
end
|
|
|
|
|
end
|