Class: Hello::Management::EmailsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hello/management/emails_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /hello/emails



21
22
23
24
25
26
27
28
29
# File 'app/controllers/hello/management/emails_controller.rb', line 21

def create
  business = Business::Management::AddEmail.new(@credential)
  if @credential.save
    redirect_to hello.emails_path, notice: business.success_message
  else
    flash.now[:alert] = business.error_message
    render_list
  end
end

#deliverObject

POST /hello/emails/1/deliver



43
44
45
46
47
48
# File 'app/controllers/hello/management/emails_controller.rb', line 43

def deliver
  business = Business::Management::SendConfirmationEmail.new(self, @credential)
  business.deliver
  flash[:notice] = business.success_message
  redirect_to hello.emails_path
end

#destroyObject

DELETE /hello/emails/1



32
33
34
35
36
37
38
39
40
# File 'app/controllers/hello/management/emails_controller.rb', line 32

def destroy
  business = Business::Management::RemoveEmail.new(@credential)
  if @credential.destroy
    redirect_to hello.emails_path, notice: business.success_message
  else
    flash.now[:alert] = business.error_message
    render_list
  end
end

#indexObject

GET /hello/emails



16
17
18
# File 'app/controllers/hello/management/emails_controller.rb', line 16

def index
  render_list
end