Class: TurboRouterGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TurboRouterGenerator
- Defined in:
- lib/generators/turbo_router_generator.rb
Instance Method Summary collapse
- #copy_turbo_router_content_partial ⇒ Object
- #copy_turbo_router_content_template ⇒ Object
- #wrap_yield_call_in_application_template ⇒ Object
Instance Method Details
#copy_turbo_router_content_partial ⇒ Object
7 8 9 |
# File 'lib/generators/turbo_router_generator.rb', line 7 def copy_turbo_router_content_partial copy_file "_turbo_router_content.erb", "app/views/layouts/_turbo_router_content.erb" end |
#copy_turbo_router_content_template ⇒ Object
11 12 13 |
# File 'lib/generators/turbo_router_generator.rb', line 11 def copy_turbo_router_content_template copy_file "turbo_router_content.erb", "app/views/layouts/turbo_router_content.erb" end |
#wrap_yield_call_in_application_template ⇒ Object
15 16 17 |
# File 'lib/generators/turbo_router_generator.rb', line 15 def wrap_yield_call_in_application_template gsub_file "app/views/layouts/application.html.erb", /(<%=\s*yield\s*%>)/, "<%= render \"layouts/turbo_router_content\" do %>\\1<% end %>" end |