From baa32a57f9f1e146fd0d23b71b38d0d40fd00c99 Mon Sep 17 00:00:00 2001 From: Trent Michaels Date: Fri, 1 Mar 2013 12:08:12 -0500 Subject: Clarified need to remove existing code in welcome index. Signed-off-by: Chelsea Macaluso --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 87f5e43157..c0cb5b0da9 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -208,7 +208,7 @@ create app/assets/stylesheets/welcome.css.scss Most important of these are of course the controller, located at `app/controllers/welcome_controller.rb` and the view, located at `app/views/welcome/index.html.erb`. -Open the `app/views/welcome/index.html.erb` file in your text editor and edit it to contain a single line of code: +Open the `app/views/welcome/index.html.erb` file in your text editor. Delete all of the existing code in the file, and replace it with the following single line of code: ```html

Hello, Rails!

-- cgit v1.2.3 From f8461f73c77c186ad0aa735fe9877990bffe1990 Mon Sep 17 00:00:00 2001 From: Chelsea Macaluso Date: Fri, 1 Mar 2013 12:32:40 -0500 Subject: Clarified removal of public/index.html file Signed-off-by: Trent Michaels --- guides/source/getting_started.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index c0cb5b0da9..95490b5e35 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -241,6 +241,8 @@ root to: "welcome#index" The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`). +You should also remove the `public/index.html` file because it might otherwise take precedence over the routes defined in `config/routes.rb`. + If you navigate to in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly. TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html). -- cgit v1.2.3 From a243f84b5ddbd12675e6354ed9f99f23241aaeed Mon Sep 17 00:00:00 2001 From: Christine Hertzel Date: Fri, 1 Mar 2013 13:05:00 -0500 Subject: Fixed grammatical error and simplified paragraph concerning controllers. Signed-off-by: Chelsea Macaluso --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 95490b5e35..742b8ae548 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -280,7 +280,7 @@ With the route defined, requests can now be made to `/posts/new` in the applicat ![Another routing error, uninitialized constant PostsController](images/getting_started/routing_error_no_controller.png) -This error is happening because this route need a controller to be defined. The route is attempting to find that controller so it can serve the request, but with the controller undefined, it just can't do that. The solution to this particular problem is simple: you need to create a controller called `PostsController`. You can do this by running this command: +This error occurs because the route needs to have a controller defined in order to serve the request. The solution to this particular problem is simple: create a controller called `PostsController`. You can do this by running this command: ```bash $ rails g controller posts -- cgit v1.2.3 From 3dde99d01c71dad36e483d0d1957639fde255c27 Mon Sep 17 00:00:00 2001 From: Christine Hertzel Date: Fri, 1 Mar 2013 14:26:54 -0500 Subject: Reverting commit regarding public/index.html (no longer in Rails 4.) This reverts commit f8461f73c77c186ad0aa735fe9877990bffe1990. --- guides/source/getting_started.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 742b8ae548..a1d7e955c8 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -241,8 +241,6 @@ root to: "welcome#index" The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`). -You should also remove the `public/index.html` file because it might otherwise take precedence over the routes defined in `config/routes.rb`. - If you navigate to in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly. TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html). -- cgit v1.2.3 From b7d50f352fc8918cc63dc6bb0f3e3d77fb7420cc Mon Sep 17 00:00:00 2001 From: David Deller Date: Fri, 1 Mar 2013 18:05:18 -0500 Subject: Add explanation of :dependent => :restrict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on information here: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many --- guides/source/association_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index dd59e2a8df..cb0a7c8026 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -845,7 +845,7 @@ Counter cache columns are added to the containing model's list of read-only attr ##### `:dependent` -If you set the `:dependent` option to `:destroy`, then deleting this object will call the `destroy` method on the associated object to delete that object. If you set the `:dependent` option to `:delete`, then deleting this object will delete the associated object _without_ calling its `destroy` method. +If you set the `:dependent` option to `:destroy`, then deleting this object will call the `destroy` method on the associated object to delete that object. If you set the `:dependent` option to `:delete`, then deleting this object will delete the associated object _without_ calling its `destroy` method. If you set the `:dependent` option to `:restrict`, then attempting to delete this object will result in a `ActiveRecord::DeleteRestrictionError` if there are any associated objects. WARNING: You should not specify this option on a `belongs_to` association that is connected with a `has_many` association on the other class. Doing so can lead to orphaned records in your database. -- cgit v1.2.3 From 55269f9849154b20cfb927cb8db246c1b2270207 Mon Sep 17 00:00:00 2001 From: Jonathan Roes Date: Tue, 5 Mar 2013 00:15:07 -0500 Subject: Remove reference to BugMash. Link hasn't been updated in 4 years. --- guides/source/contributing_to_ruby_on_rails.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'guides') diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index 7909a00c47..cc4e369e7d 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -250,8 +250,6 @@ Your name can be added directly after the last word if you don't provide any cod You should not be the only person who looks at the code before you submit it. You know at least one other Rails developer, right? Show them what you’re doing and ask for feedback. Doing this in private before you push a patch out publicly is the “smoke test” for a patch: if you can’t convince one other developer of the beauty of your code, you’re unlikely to convince the core team either. -You might want also to check out the [RailsBridge BugMash](http://wiki.railsbridge.org/projects/railsbridge/wiki/BugMash) as a way to get involved in a group effort to improve Rails. This can help you get started and help you check your code when you're writing your first patches. - ### Commit Your Changes When you're happy with the code on your computer, you need to commit the changes to Git: -- cgit v1.2.3