From 2222ebb2b0e4d1519b9d2efd3a765b71c411a27e Mon Sep 17 00:00:00 2001 From: Zachary Porter Date: Fri, 11 Jan 2013 13:53:25 -0500 Subject: Update engine application layout file path --- guides/source/engines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index f35233993c..b5af634e59 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -263,7 +263,7 @@ This helps prevent conflicts with any other engine or application that may have Finally, two files that are the assets for this resource are generated, `app/assets/javascripts/blorgh/posts.js` and `app/assets/javascripts/blorgh/posts.css`. You'll see how to use these a little later. -By default, the scaffold styling is not applied to the engine as the engine's layout file, `app/views/blorgh/application.html.erb` doesn't load it. To make this apply, insert this line into the `` tag of this layout: +By default, the scaffold styling is not applied to the engine as the engine's layout file, `app/views/layouts/blorgh/application.html.erb` doesn't load it. To make this apply, insert this line into the `` tag of this layout: ```erb <%= stylesheet_link_tag "scaffold" %> -- cgit v1.2.3 From 0a89d4db1e06d06026bc73726a47d2ef20748070 Mon Sep 17 00:00:00 2001 From: Zachary Porter Date: Fri, 11 Jan 2013 14:07:14 -0500 Subject: Fix typo in guides/source/engines.md --- guides/source/engines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index b5af634e59..649bfad100 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -288,7 +288,7 @@ Now people will only need to go to the root of the engine to see all the posts, ### Generating a comments resource -Now that the engine can to create new blog posts, it only makes sense to add commenting functionality as well. To do get this, you'll need to generate a comment model, a comment controller and then modify the posts scaffold to display comments and allow people to create new ones. +Now that the engine can create new blog posts, it only makes sense to add commenting functionality as well. To do get this, you'll need to generate a comment model, a comment controller and then modify the posts scaffold to display comments and allow people to create new ones. Run the model generator and tell it to generate a `Comment` model, with the related table having two columns: a `post_id` integer and `text` text column. -- cgit v1.2.3 From d2d07b3adea8f443296dfb67c9c568d35d1e13bc Mon Sep 17 00:00:00 2001 From: Zachary Porter Date: Fri, 11 Jan 2013 15:26:05 -0500 Subject: Fix typo in guides/source/engines.md --- guides/source/engines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index 649bfad100..0a346b28f9 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -288,7 +288,7 @@ Now people will only need to go to the root of the engine to see all the posts, ### Generating a comments resource -Now that the engine can create new blog posts, it only makes sense to add commenting functionality as well. To do get this, you'll need to generate a comment model, a comment controller and then modify the posts scaffold to display comments and allow people to create new ones. +Now that the engine can create new blog posts, it only makes sense to add commenting functionality as well. To do this, you'll need to generate a comment model, a comment controller and then modify the posts scaffold to display comments and allow people to create new ones. Run the model generator and tell it to generate a `Comment` model, with the related table having two columns: a `post_id` integer and `text` text column. -- cgit v1.2.3 From 634a2aafbea9e50a722a9f0245d650239296f3be Mon Sep 17 00:00:00 2001 From: Brian Littmann Date: Tue, 22 Jan 2013 15:17:16 -0600 Subject: Typo fix in guides/source/engines.md --- guides/source/engines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index 0a346b28f9..bcbabc7eec 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -261,7 +261,7 @@ end This helps prevent conflicts with any other engine or application that may have a post resource as well. -Finally, two files that are the assets for this resource are generated, `app/assets/javascripts/blorgh/posts.js` and `app/assets/javascripts/blorgh/posts.css`. You'll see how to use these a little later. +Finally, two files that are the assets for this resource are generated, `app/assets/javascripts/blorgh/posts.js` and `app/assets/stylesheets/blorgh/posts.css`. You'll see how to use these a little later. By default, the scaffold styling is not applied to the engine as the engine's layout file, `app/views/layouts/blorgh/application.html.erb` doesn't load it. To make this apply, insert this line into the `` tag of this layout: -- cgit v1.2.3 From bceeeaa4bd06e526b72538bd5206a3227f6fb2cb Mon Sep 17 00:00:00 2001 From: Brian Littmann Date: Tue, 22 Jan 2013 15:59:49 -0600 Subject: Typo, grammar, and comma love. --- guides/source/engines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index bcbabc7eec..f6c7800828 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -470,7 +470,7 @@ If you have multiple engines that need migrations copied over, use `railties:ins $ rake railties:install:migrations ``` -This command, when run for the first time will copy over all the migrations from the engine. When run the next time, it will only copy over migrations that haven't been copied over already. The first run for this command will output something such as this: +This command, when run for the first time, will copy over all the migrations from the engine. When run the next time, it will only copy over migrations that haven't been copied over already. The first run for this command will output something such as this: ```bash Copied migration [timestamp_1]_create_blorgh_posts.rb from blorgh @@ -754,7 +754,7 @@ end #### Implementing Decorator Pattern Using ActiveSupport::Concern -Using `Class#class_eval` is great for simple adjustments, but for more complex class modifications, you might want to consider using [`ActiveSupport::Concern`](http://edgeapi.rubyonrails.org/classes/ActiveSupport/Concern.html) helps manage load order of interlinked dependencies at run time allowing you to significantly modularize your code. +Using `Class#class_eval` is great for simple adjustments, but for more complex class modifications, you might want to consider using [`ActiveSupport::Concern`](http://edgeapi.rubyonrails.org/classes/ActiveSupport/Concern.html) which helps manage load order of interlinked dependencies at run time allowing you to significantly modularize your code. **Adding** `Post#time_since_created`
**Overriding** `Post#summary` @@ -790,7 +790,7 @@ module Blorgh::Concerns::Models::Post extend ActiveSupport::Concern # 'included do' causes the included code to be evaluated in the - # conext where it is included (post.rb), rather than be + # context where it is included (post.rb), rather than be # executed in the module's context (blorgh/concerns/models/post). included do attr_accessor :author_name @@ -840,7 +840,7 @@ Try this now by creating a new file at `app/views/blorgh/posts/index.html.erb` a ### Routes -Routes inside an engine are, by default, isolated from the application. This is done by the `isolate_namespace` call inside the `Engine` class. This essentially means that the application and its engines can have identically named routes, and that they will not clash. +Routes inside an engine are, by default, isolated from the application. This is done by the `isolate_namespace` call inside the `Engine` class. This essentially means that the application and its engines can have identically named routes and they will not clash. Routes inside an engine are drawn on the `Engine` class within `config/routes.rb`, like this: -- cgit v1.2.3 From 9133aadfe2f390efe6c931a39c8724189b1d5bff Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Thu, 24 Jan 2013 02:42:21 -0600 Subject: [engines guide] reworded a run on --- guides/source/engines.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index f6c7800828..20989cc61b 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -754,10 +754,9 @@ end #### Implementing Decorator Pattern Using ActiveSupport::Concern -Using `Class#class_eval` is great for simple adjustments, but for more complex class modifications, you might want to consider using [`ActiveSupport::Concern`](http://edgeapi.rubyonrails.org/classes/ActiveSupport/Concern.html) which helps manage load order of interlinked dependencies at run time allowing you to significantly modularize your code. +Using `Class#class_eval` is great for simple adjustments, but for more complex class modifications, you might want to consider using [`ActiveSupport::Concern`](http://edgeapi.rubyonrails.org/classes/ActiveSupport/Concern.html). ActiveSupport::Concern manages load order of interlinked dependent modules and classes at run time allowing you to significantly modularize your code. -**Adding** `Post#time_since_created`
-**Overriding** `Post#summary` +**Adding** `Post#time_since_created` and **Overriding** `Post#summary` ```ruby # MyApp/app/models/blorgh/post.rb -- cgit v1.2.3 From 97b249112d2a66ac19828e0c3875681d4d60c08f Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Thu, 24 Jan 2013 02:42:40 -0600 Subject: [engines guide] reformatted some stuff --- guides/source/engines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides/source/engines.md') diff --git a/guides/source/engines.md b/guides/source/engines.md index 20989cc61b..459aa8d57e 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -799,9 +799,9 @@ module Blorgh::Concerns::Models::Post private - def set_author - self.author = User.find_or_create_by(name: author_name) - end + def set_author + self.author = User.find_or_create_by(name: author_name) + end end def summary -- cgit v1.2.3