Class: Global::Error
- Inherits:
-
Components::Base
- Object
- Components::Base
- Global::Error
- Includes:
- Phlex::Rails::Helpers::TurboFrameTag
- Defined in:
- app/components/databasium/global/error.rb
Instance Method Summary collapse
-
#initialize(message: nil, details: nil, type: nil) ⇒ Error
constructor
A new instance of Error.
- #view_template ⇒ Object
Constructor Details
#initialize(message: nil, details: nil, type: nil) ⇒ Error
Returns a new instance of Error.
8 9 10 11 12 |
# File 'app/components/databasium/global/error.rb', line 8 def initialize(message: nil, details: nil, type: nil) @message = @details = details @type = type end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/databasium/global/error.rb', line 14 def view_template div(id: "error") do div( class: "absolute top-20 left-1/2 -translate-x-1/2 px-4 z-50 transition-opacity duration-1000 ease-in-out", data: { controller: "error" } ) { render_error if @message || @details } end end |