Skip to content

Commit

Permalink
better message
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagab committed Sep 14, 2024
1 parent 197cbd3 commit b2d8a1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/phlex/rails/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Overrides
class HelpersCalledBeforeRenderError < StandardError; end

def helpers
raise HelpersCalledBeforeRenderError.new("Do not call `helpers` until after the view has been rendered.") unless @_view_context
raise HelpersCalledBeforeRenderError.new("Do not use rails helpers until after the view has been rendered.") unless @_view_context

if defined?(ViewComponent::Base) && ViewComponent::Base === @_view_context
@_view_context.helpers
Expand Down
2 changes: 1 addition & 1 deletion test/phlex/helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HelpersTest < ActionDispatch::IntegrationTest
get "/helpers/helper_in_initializer"
end

assert_equal "Do not call `helpers` until after the view has been rendered.", error.message
assert_equal "Do not use rails helpers until after the view has been rendered.", error.message
end

test "form with" do
Expand Down

0 comments on commit b2d8a1d

Please sign in to comment.