@@ -6,33 +6,21 @@ class InstallGenerator < ::Rails::Generators::Base
6
6
7
7
APPLICATION_CONFIGURATION_PATH = Rails . root . join ( "config/application.rb" )
8
8
9
- def autoload_components
9
+ ADD_EXTRA_AUTOLOAD_PATHS_CODE = <<-ADD_EXTRA_AUTOLOAD_PATHS_CODE
10
+ config.autoload_paths.push(
11
+ "\# {root}/app/views/components",
12
+ "\# {root}/app/views",
13
+ "\# {root}/app/views/layouts"
14
+ )
15
+ ADD_EXTRA_AUTOLOAD_PATHS_CODE
16
+
17
+ def autoload_components_layouts_views
10
18
return unless APPLICATION_CONFIGURATION_PATH . exist?
11
19
12
20
inject_into_class (
13
21
APPLICATION_CONFIGURATION_PATH ,
14
22
"Application" ,
15
- %( config.autoload_paths << "\# {root}/app/views/components"\n ) ,
16
- )
17
- end
18
-
19
- def autoload_layouts
20
- return unless APPLICATION_CONFIGURATION_PATH . exist?
21
-
22
- inject_into_class (
23
- APPLICATION_CONFIGURATION_PATH ,
24
- "Application" ,
25
- %( config.autoload_paths << "\# {root}/app/views/layouts"\n ) ,
26
- )
27
- end
28
-
29
- def autoload_views
30
- return unless APPLICATION_CONFIGURATION_PATH . exist?
31
-
32
- inject_into_class (
33
- APPLICATION_CONFIGURATION_PATH ,
34
- "Application" ,
35
- %( config.autoload_paths << "\# {root}/app/views"\n ) ,
23
+ ADD_EXTRA_AUTOLOAD_PATHS_CODE ,
36
24
)
37
25
end
38
26
@@ -56,7 +44,7 @@ def create_application_view
56
44
template "application_view.rb" , Rails . root . join ( "app/views/application_view.rb" )
57
45
end
58
46
59
- private
47
+ private
60
48
61
49
def tailwind_configuration_path
62
50
@_tailwind_configuration_path ||=
0 commit comments