Class: Components::ModelSummary

Inherits:
ModelCard
  • Object
show all
Defined in:
app/components/model_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(model:) ⇒ ModelSummary

Returns a new instance of ModelSummary.



4
5
6
# File 'app/components/model_summary.rb', line 4

def initialize(model:)
  @model = model
end

Instance Method Details

#view_template ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/components/model_summary.rb', line 8

def view_template
  div class: "card" do
    div class: "card-body row" do
      div class: "col" do
        h5 { @model.name }
        span { @model.model_files.count }
        whitespace
        span { ModelFile.model_name.human count: @model.model_files.count }
        span { " : " }
        code { @model.path }
      end
      div(class: "col-auto") do
        credits
        div { @model.tags.map { Tag(tag: it) } }
      end
    end
  end
end