Class: TurboFlow::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_initializerObject



9
10
11
# File 'lib/generators/turbo_flow/install/install_generator.rb', line 9

def create_initializer
  template "turboflow.rb", "config/initializers/turboflow.rb"
end

#display_post_install_messageObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/generators/turbo_flow/install/install_generator.rb', line 20

def display_post_install_message
  say "\n" + "="*60, :blue
  say "TurboFlow installation complete!", :green
  say "="*60 + "\n", :blue

  say "\nLayout Updates:", :yellow
  say "   • turboflow_meta_tags added to <head>\n"

  say "\nUsage Examples:", :yellow
  say "   • Link with transition:"
  say "   • <%= link_flow_to 'About', about_path, flow: :slide %>\n"

  say "   • Button with transition:"
  say "   • <%= button_flow_to 'Submit', path, flow: :zoom %>\n"

  say "   • Available transitions: fade, slide, zoom, flip, morph\n"

  say "\nConfiguration:", :yellow
  say "   • Edit config/initializers/turboflow.rb to customize defaults\n"

  say "\nDocumentation:", :yellow
  say "   • https://github.com/Nickiam7/turboflow\n"
end

#update_application_layoutObject



13
14
15
16
17
18
# File 'lib/generators/turbo_flow/install/install_generator.rb', line 13

def update_application_layout
  return unless File.exist?(application_layout_path)

  insert_turboflow_meta_tags
  # No longer replacing body tags - just use regular <body> tags
end