Class: LetterBomb::MailersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/letter_bomb/mailers_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/letter_bomb/mailers_controller.rb', line 3

def index
  @mailer_classes = LetterBomb::Preview.classes
end

#showObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/letter_bomb/mailers_controller.rb', line 7

def show
  class_name  = params[:mailer_class]
  action_name = params[:mailer_action]

  @action = class_name.constantize.preview_action(
    action_name,
    format: params[:format]
  )

  respond_to do |format|
    format.html

    format.text {
      render formats: [:html],
             content_type: 'text/html'
    }
  end
end