Class: Models::HeaderActions
- Inherits:
-
Components::Base
- Object
- Components::Base
- Models::HeaderActions
- Includes:
- Phlex::Rails::Helpers::ButtonTo, Phlex::Rails::Helpers::LinkTo, Phlex::Rails::Helpers::Routes, Phlex::Rails::Helpers::TurboFrameTag
- Defined in:
- app/components/databasium/models/header_actions.rb
Instance Method Summary collapse
-
#initialize(model: nil) ⇒ HeaderActions
constructor
A new instance of HeaderActions.
- #view_template ⇒ Object
Constructor Details
#initialize(model: nil) ⇒ HeaderActions
Returns a new instance of HeaderActions.
10 11 12 |
# File 'app/components/databasium/models/header_actions.rb', line 10 def initialize(model: nil) @model = model end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/components/databasium/models/header_actions.rb', line 14 def view_template div(id: "header_actions", class: "max-w-full overflow-x-auto") do render Components::Databasium::Navigation::IconPanel.new( icons_with_text: [ { icon: "plus-circle", text: "Add attribute", method: :frontend, data_params: { action: "click->model#add", model_target_param: "attribute", model_container_param: "attributesContainer" } }, { icon: "plus-circle", text: "Add relation", method: :frontend, data_params: { action: "click->model#add", model_target_param: "relation", model_container_param: "relationsContainer" } }, { icon: "document-plus", text: "New model", method: :get, path: databasium.new_model_path, turbo_frame: "main" } ] ) end end |