Class: TurboRouterGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/turbo_router_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_turbo_router_content_partialObject



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_templateObject



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_templateObject



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