Class: Models::ModelPreview
- Inherits:
-
Components::Base
- Object
- Components::Base
- Models::ModelPreview
- Defined in:
- app/components/databasium/models/model_preview.rb
Instance Method Summary collapse
-
#initialize(content:) ⇒ ModelPreview
constructor
A new instance of ModelPreview.
- #view_template ⇒ Object
Constructor Details
#initialize(content:) ⇒ ModelPreview
Returns a new instance of ModelPreview.
4 5 6 |
# File 'app/components/databasium/models/model_preview.rb', line 4 def initialize(content:) @content = content 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 26 27 28 |
# File 'app/components/databasium/models/model_preview.rb', line 8 def view_template div(id: "model_preview") do div(class: "bg-panel border-1 border-border rounded-xl p-4 min-h-full flex-1") do if @content h1(class: "text-xl font-semibold mb-3 border-b-2 border-border pb-3") do "Preview for Model" end pre(class: "bg-panel border-1 border-border rounded-xl p-4") { @content } ( type: "submit", form: "model_form", name: "commit", value: "Create model file", class: "bg-accent shadow-accent rounded-xl p-1 px-4 py-2 mt-2" ) { "Create model file" } else h1(class: "text-xl font-semibold") { "Please fill out the form to see the preview" } end end end end |