2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-07 07:42:22 +03:00
|
|
|
class EmailsController < ApplicationController
|
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])
|
|
|
|
|
redirect_to(admin_conference_emails_path(
|
|
|
|
|
@conference.short_title),
|
|
|
|
|
notice: 'Settings have been successfully updated.')
|
|
|
|
|
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
|