Skip to content
Browse files

copy editing [ci skip]

  • Loading branch information...
1 parent 219342b commit d897255f8a25c72aa72f14d2f82cb87058447fac @vijaydev vijaydev committed May 12, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 guides/source/engines.textile
View
10 guides/source/engines.textile
@@ -548,16 +548,16 @@ Now instead of the ugly Ruby object output the author's name will be displayed.
h5. Using a controller provided by the application
-Because Rails controllers generally share code for for things like authentication and accessing session variables, by default they inherit from ApplicationController. Rails engines, however are scoped to run independently from the main application, so each engine gets a scoped ApplicationController. This namespace prevents code collisions, but often engine controllers should access methods in the main application's ApplicationController. An easy way to provide this acess is to change the engine's scoped ApplicationController to inherit from the main application's ApplicationController. For our Blorgh engine this would be done by changing +app/controllers/blorgh/application_controller.rb+ to look like:
+Because Rails controllers generally share code for things like authentication and accessing session variables, by default they inherit from <tt>ApplicationController</tt>. Rails engines, however are scoped to run independently from the main application, so each engine gets a scoped +ApplicationController+. This namespace prevents code collisions, but often engine controllers should access methods in the main application's +ApplicationController+. An easy way to provide this access is to change the engine's scoped +ApplicationController+ to inherit from the main application's +ApplicationController+. For our Blorgh engine this would be done by changing +app/controllers/blorgh/application_controller.rb+ to look like:
<ruby>
- class Blorgh::ApplicationController < ApplicationController
- end
+class Blorgh::ApplicationController < ApplicationController
+end
</ruby>
-By default, the engine's controllers inherit from Blorgh::ApplicationController. So, after making this change they will have access to the main applications ApplicationController as though they were part of the main application.
+By default, the engine's controllers inherit from <tt>Blorgh::ApplicationController</tt>. So, after making this change they will have access to the main applications +ApplicationController+ as though they were part of the main application.
-This change does require that the engine is run from a Rails application that has an ApplicationController.
+This change does require that the engine is run from a Rails application that has an +ApplicationController+.
h4. Configuring an engine

0 comments on commit d897255

Please sign in to comment.
Something went wrong with that request. Please try again.