File tree 1 file changed +9
-21
lines changed
lib/generators/phlex/install
1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -6,34 +6,22 @@ class InstallGenerator < ::Rails::Generators::Base
6
6
7
7
APPLICATION_CONFIGURATION_PATH = Rails . root . join ( "config/application.rb" )
8
8
TAILWIND_CONFIGURATION_PATH = Rails . root . join ( "tailwind.config.js" )
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
+ )
9
15
10
- def autoload_components
11
- return unless APPLICATION_CONFIGURATION_PATH . exist?
12
-
13
- inject_into_class (
14
- APPLICATION_CONFIGURATION_PATH ,
15
- "Application" ,
16
- %( config.autoload_paths << "\# {root}/app/views/components"\n ) ,
17
- )
18
- end
19
-
20
- def autoload_layouts
21
- return unless APPLICATION_CONFIGURATION_PATH . exist?
22
-
23
- inject_into_class (
24
- APPLICATION_CONFIGURATION_PATH ,
25
- "Application" ,
26
- %( config.autoload_paths << "\# {root}/app/views/layouts"\n ) ,
27
- )
28
- end
16
+ ADD_EXTRA_AUTOLOAD_PATHS_CODE
29
17
30
- def autoload_views
18
+ def autoload_components_layouts_views
31
19
return unless APPLICATION_CONFIGURATION_PATH . exist?
32
20
33
21
inject_into_class (
34
22
APPLICATION_CONFIGURATION_PATH ,
35
23
"Application" ,
36
- %( config.autoload_paths << " \# {root}/app/views" \n ) ,
24
+ ADD_EXTRA_AUTOLOAD_PATHS_CODE ,
37
25
)
38
26
end
39
27
You can’t perform that action at this time.
0 commit comments