osem-fcy/app/controllers/admin/emails_controller.rb
2014-08-13 22:53:13 +03:00

18 lines
574 B
Ruby

module Admin
class EmailsController < ApplicationController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource class: EmailSettings
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
def index
authorize! :index, @conference.email_settings
@settings = @conference.email_settings
end
end
end