Class: Hello::Management::EmailsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Hello::Management::EmailsController
- Defined in:
- app/controllers/hello/management/emails_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /hello/emails.
-
#deliver ⇒ Object
POST /hello/emails/1/deliver.
-
#destroy ⇒ Object
DELETE /hello/emails/1.
-
#index ⇒ Object
GET /hello/emails.
Instance Method Details
#create ⇒ Object
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. else flash.now[:alert] = business. render_list end end |
#deliver ⇒ Object
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. redirect_to hello.emails_path end |
#destroy ⇒ Object
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. else flash.now[:alert] = business. render_list end end |
#index ⇒ Object
GET /hello/emails
16 17 18 |
# File 'app/controllers/hello/management/emails_controller.rb', line 16 def index render_list end |