Class: Iron::Generators::PagesGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routesObject



16
17
18
# File 'lib/generators/iron/pages/pages_generator.rb', line 16

def add_routes
  route "iron_pages"
end

#create_controllerObject



8
9
10
# File 'lib/generators/iron/pages/pages_generator.rb', line 8

def create_controller
  template "pages_controller.rb", "app/controllers/pages_controller.rb"
end

#create_viewsObject



12
13
14
# File 'lib/generators/iron/pages/pages_generator.rb', line 12

def create_views
  template "show.html.erb", "app/views/pages/show.html.erb"
end

#display_instructionsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/iron/pages/pages_generator.rb', line 20

def display_instructions
  say "\n=== Iron CMS Pages Setup Complete ===\n", :green
  say "The pages controller has been installed in your application.\n"
  say "\nNext steps:"
  say "1. Create custom views for your content types in app/views/templates/"
  say "   For a content type with handle 'article', create:"
  say "   - app/views/templates/article.html.erb"
  say "\n2. The default view (app/views/pages/show.html.erb) will be used"
  say "   for any content types without custom views."
  say "\n3. The iron_entry_path helper is available from the Iron engine."
  say "\n4. Remember to restart your Rails server after installation."
end