Class: Monolith::GeneratorsController::Index

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

Overview

Phlex views

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#generators=(value) ⇒ Object (writeonly)

Sets the attribute generators

Parameters:

  • value

    the value to set the attribute generators to.



168
169
170
# File 'app/controllers/monolith/generators_controller.rb', line 168

def generators=(value)
  @generators = value
end

Instance Method Details

#view_templateObject



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'app/controllers/monolith/generators_controller.rb', line 170

def view_template
  div(class: "p-6 space-y-4") do
    h1(class: "text-2xl font-bold") { "Generators" }
    p(class: "text-sm") { "#{@generators.size} Rails generators available." }

    Table @generators do
      it.row("Generator") {
        nav_link it.name, controller: "/monolith/generators", action: :show, id: it.to_param
      }
      it.row("Namespace") { |g|
        code { g.namespace }
      }
      it.row("Description") {
        it.description || em { "—" }
      }
    end
  end
end