Class: Monolith::EmailsController::Index

Inherits:
View
  • Object
show all
Defined in:
app/controllers/monolith/emails_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emails=(value) ⇒ Object (writeonly)

Sets the attribute emails

Parameters:

  • value

    the value to set the attribute emails to.



13
14
15
# File 'app/controllers/monolith/emails_controller.rb', line 13

def emails=(value)
  @emails = value
end

Instance Method Details

#view_templateObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/monolith/emails_controller.rb', line 15

def view_template
  div(class: "p-6 space-y-4") do
    h1(class: "text-2xl font-bold") { "Emails" }
    ul(class: "list-disc pl-6 space-y-1") {
      @emails.each do |email|
        li {
          if email.respond_to? :preview
            nav_link email.to_s, action: :show, id: email.to_s
          else
            plain email.to_s
          end
        }
      end
    }
  end
end