Exception: ViewComponent::DuplicateContentError

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) ⇒ DuplicateContentError

Returns a new instance of DuplicateContentError.



47
48
49
# File 'lib/view_component/errors.rb', line 47

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