Exception: ViewComponent::TranslateCalledBeforeRenderError

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

Constant Summary collapse

MESSAGE =
"`#translate` can't be used during initialization as it depends " \
"on the view context that only exists once a ViewComponent is passed to " \
"the Rails render pipeline.\n\n" \
"It's sometimes possible to fix this issue by moving code dependent on " \
"`#translate` to a [`#before_render` method](https://viewcomponent.org/api.html#before_render--void)."

Method Summary

Methods inherited from BaseError

#initialize

Constructor Details

This class inherits a constructor from ViewComponent::BaseError