osem-fcy/app/controllers/admin/emails_controller.rb
Stella Rouzi 01086813af Style
2015-10-17 16:57:48 +03:00

18 lines
551 B
Ruby

module Admin
class EmailsController < Admin::BaseController
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])
flash[:notice] = 'Settings have been successfully updated.'
redirect_to admin_conference_emails_path(@conference.short_title)
end
def index
authorize! :index, @conference.email_settings
@settings = @conference.email_settings
end
end
end