Skip to content

Commit f51244e

Browse files
Copilotjonrohan
andauthored
Fix FormHelper loading with Rails 7+ add_autoload_paths_to_load_path = false (#3877)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com> Co-authored-by: Jon Rohan <rohan@github.com>
1 parent f9fd6c8 commit f51244e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.changeset/rich-glasses-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
Fix Primer::FormHelper compatibility with Rails 7+ config

lib/primer/view_components/engine.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ class Engine < ::Rails::Engine
4848

4949
initializer "primer.forms.helpers" do
5050
ActiveSupport.on_load :action_controller_base do
51-
begin
52-
require "primer/form_helper"
53-
rescue LoadError
54-
end
51+
require_relative "../../../app/helpers/primer/form_helper"
5552

5653
helper Primer::FormHelper
5754

0 commit comments

Comments
 (0)