From bb8ee9264f8302ea9f669c96f46d9c3812d6f350 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 15 Oct 2011 09:51:30 +1100 Subject: [engines guide] improve intro to 'Hooking into an application' section --- railties/guides/source/engines.textile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'railties/guides/source/engines.textile') diff --git a/railties/guides/source/engines.textile b/railties/guides/source/engines.textile index 126d09ab87..4f77852c40 100644 --- a/railties/guides/source/engines.textile +++ b/railties/guides/source/engines.textile @@ -343,9 +343,13 @@ The +comment_counter+ local variable is given to us by the +<%= render @post.com That completes the comment function of the blogging engine. Now it's time to use it within an application. -h3. Hooking into application +h3. Hooking into an application -Using an engine within an application is very easy. First, the engine needs to be specified inside the application's +Gemfile+. If there isn't an application handy to test this out in, generate one using the +rails new+ command outside of the engine directory like this: +Using an engine within an application is very easy. This section covers how to mount the engine into an application and the initial setup required for it, as well as linking the engine to a +User+ class provided by the application to provide ownership for posts and comments within the engine. + +h4. Mounting the engine + +First, the engine needs to be specified inside the application's +Gemfile+. If there isn't an application handy to test this out in, generate one using the +rails new+ command outside of the engine directory like this: $ rails new unicorn -- cgit v1.2.3