Exception: ViewComponent::DuplicateSlotContentError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/view_component/errors.rb

Constant Summary collapse

MESSAGE =
"It looks like a block was provided after calling `with_content` on COMPONENT, " \
"which means that ViewComponent doesn't know which content to use.\n\n" \
"To fix this issue, use either `with_content` or a block."

Instance Method Summary collapse

Constructor Details

#initialize(klass_name) ⇒ DuplicateSlotContentError

Returns a new instance of DuplicateSlotContentError.



14
15
16
# File 'lib/view_component/errors.rb', line 14

def initialize(klass_name)
  super(MESSAGE.gsub("COMPONENT", klass_name.to_s))
end