Class: Monolith::TablesController::Index

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

Overview

Phlex views

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tables=(value) ⇒ Object (writeonly)

Sets the attribute tables

Parameters:

  • the value to set the attribute tables to.



107
108
109
# File 'app/controllers/monolith/tables_controller.rb', line 107

def tables=(value)
  @tables = value
end

Instance Method Details

#view_templateObject



109
110
111
112
113
114
115
116
117
118
# File 'app/controllers/monolith/tables_controller.rb', line 109

def view_template
  div(class: "p-6 space-y-4") do
    h1(class: "text-2xl font-bold") { "Tables" }
    ul(class: "list-disc pl-6 space-y-1") do
      @tables.each do |t|
        li { nav_link t.name, controller: "/monolith/tables", action: :show, id: t.name }
      end
    end
  end
end