Skip to content

Commit

Permalink
align documentation with conventional practice
Browse files Browse the repository at this point in the history
and in the process, clear up potential sources of confusion for
learners.
  • Loading branch information
yawboakye committed Sep 3, 2024
1 parent d5c2ff8 commit 7e4560b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions railties/lib/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ module Rails
# To add an initialization step to the \Rails boot process from your railtie, just
# define the initialization code with the +initializer+ macro:
#
# class MyRailtie < Rails::Railtie
# initializer "my_railtie.configure_rails_initialization" do
# class MyGem::Railtie < Rails::Railtie
# initializer "my_gem.configure_rails_initialization" do
# # some initialization behavior
# end
# end
#
# If specified, the block can also receive the application object, in case you
# need to access some application-specific configuration, like middleware:
#
# class MyRailtie < Rails::Railtie
# initializer "my_railtie.configure_rails_initialization" do |app|
# app.middleware.use MyRailtie::Middleware
# class MyGem::Railtie < Rails::Railtie
# initializer "my_gem.configure_rails_initialization" do |app|
# app.middleware.use MyGem::Middleware
# end
# end
#
Expand All @@ -74,14 +74,14 @@ module Rails
# Railties can access a config object which contains configuration shared by all
# railties and the application:
#
# class MyRailtie < Rails::Railtie
# class MyGem::Railtie < Rails::Railtie
# # Customize the ORM
# config.app_generators.orm :my_railtie_orm
# config.app_generators.orm :my_gem_orm
#
# # Add a to_prepare block which is executed once in production
# # and before each request in development.
# config.to_prepare do
# MyRailtie.setup!
# MyGem.setup!
# end
# end
#
Expand All @@ -90,19 +90,19 @@ module Rails
# If your railtie has Rake tasks, you can tell \Rails to load them through the method
# +rake_tasks+:
#
# class MyRailtie < Rails::Railtie
# class MyGem::Railtie < Rails::Railtie
# rake_tasks do
# load "path/to/my_railtie.tasks"
# load "path/to/my_gem.tasks"
# end
# end
#
# By default, \Rails loads generators from your load path. However, if you want to place
# your generators at a different location, you can specify in your railtie a block which
# will load them during normal generators lookup:
#
# class MyRailtie < Rails::Railtie
# class MyGem::Railtie < Rails::Railtie
# generators do
# require "path/to/my_railtie_generator"
# require "path/to/my_gem_generator"
# end
# end
#
Expand All @@ -120,7 +120,7 @@ module Rails
# this less confusing for everyone.
# It can be used like this:
#
# class MyRailtie < Rails::Railtie
# class MyGem::Railtie < Rails::Railtie
# server do
# WebpackServer.start
# end
Expand Down

0 comments on commit 7e4560b

Please sign in to comment.