aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/getting_started.md
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-01 14:31:23 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-01 14:31:23 -0500
commit76ea63c8bbea8fc6e9a79b9a575ebb2087687fb6 (patch)
tree6f2c53d43cfeea1b0cb4d242be451c95ec4368c9 /guides/source/getting_started.md
parentc7d39f2a2e377c020e57747b70502c51fd0b6349 (diff)
downloadrails-76ea63c8bbea8fc6e9a79b9a575ebb2087687fb6.tar.gz
rails-76ea63c8bbea8fc6e9a79b9a575ebb2087687fb6.tar.bz2
rails-76ea63c8bbea8fc6e9a79b9a575ebb2087687fb6.zip
use <url> markdown syntax instead of [url](url) [ci skip]
Diffstat (limited to 'guides/source/getting_started.md')
-rw-r--r--guides/source/getting_started.md26
1 files changed, 13 insertions, 13 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 28adad3855..cb3239ae48 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -154,7 +154,7 @@ $ rails server
TIP: Compiling CoffeeScript to JavaScript requires a JavaScript runtime and the absence of a runtime will give you an `execjs` error. Usually Mac OS X and Windows come with a JavaScript runtime installed. Rails adds the `therubyracer` gem to Gemfile in a commented line for new apps and you can uncomment if you need it. `therubyrhino` is the recommended runtime for JRuby users and is added by default to Gemfile in apps generated under JRuby. You can investigate about all the supported runtimes at [ExecJS](https://github.com/sstephenson/execjs#readme).
-This will fire up WEBrick, a webserver built into Ruby by default. To see your application in action, open a browser window and navigate to [http://localhost:3000](http://localhost:3000). You should see the Rails default information page:
+This will fire up WEBrick, a webserver built into Ruby by default. To see your application in action, open a browser window and navigate to <http://localhost:3000>. You should see the Rails default information page:
![Welcome Aboard screenshot](images/rails_welcome.png)
@@ -207,11 +207,11 @@ Open the `app/views/welcome/index.html.erb` file in your text editor and edit it
### Setting the Application Home Page
-Now that we have made the controller and view, we need to tell Rails when we want Hello Rails! to show up. In our case, we want it to show up when we navigate to the root URL of our site, [http://localhost:3000](http://localhost:3000). At the moment, however, the "Welcome Aboard" smoke test is occupying that spot.
+Now that we have made the controller and view, we need to tell Rails when we want Hello Rails! to show up. In our case, we want it to show up when we navigate to the root URL of our site, <http://localhost:3000>. At the moment, however, the "Welcome Aboard" smoke test is occupying that spot.
To fix this, delete the `index.html` file located inside the `public` directory of the application.
-You need to do this because Rails will serve any static file in the `public` directory that matches a route in preference to any dynamic content you generate from the controllers. The `index.html` file is special: it will be served if a request comes in at the root route, e.g. [http://localhost:3000](http://localhost:3000). If another request such as [http://localhost:3000/welcome](http://localhost:3000/welcome) happened, a static file at `public/welcome.html` would be served first, but only if it existed.
+You need to do this because Rails will serve any static file in the `public` directory that matches a route in preference to any dynamic content you generate from the controllers. The `index.html` file is special: it will be served if a request comes in at the root route, e.g. <http://localhost:3000>. If another request such as <http://localhost:3000/welcome> happened, a static file at `public/welcome.html` would be served first, but only if it existed.
Next, you have to tell Rails where your actual home page is located.
@@ -235,9 +235,9 @@ This is your application's _routing file_ which holds entries in a special DSL (
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 [http://localhost:3000/welcome/index](http://localhost:3000/welcome/index) to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller 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 <http://localhost:3000/welcome/index> to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`).
-If you navigate to [http://localhost:3000](http://localhost:3000) 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.
+If you navigate to <http://localhost:3000> 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.
NOTE. For more information about routing, refer to [Rails Routing from the Outside In](routing.html).
@@ -256,7 +256,7 @@ It will look a little basic for now, but that's ok. We'll look at improving the
### Laying down the ground work
-The first thing that you are going to need to create a new post within the application is a place to do that. A great place for that would be at `/posts/new`. If you attempt to navigate to that now -- by visiting [http://localhost:3000/posts/new](http://localhost:3000/posts/new) -- Rails will give you a routing error:
+The first thing that you are going to need to create a new post within the application is a place to do that. A great place for that would be at `/posts/new`. If you attempt to navigate to that now -- by visiting <http://localhost:3000/posts/new> -- Rails will give you a routing error:
![A routing error, no route matches /posts/new](images/getting_started/routing_error_no_route_matches.png)
@@ -270,7 +270,7 @@ get "posts/new"
This route is a super-simple route: it defines a new route that only responds to `GET` requests, and that the route is at `posts/new`. But how does it know where to go without the use of the `:to` option? Well, Rails uses a sensible default here: Rails will assume that you want this route to go to the new action inside the posts controller.
-With the route defined, requests can now be made to `/posts/new` in the application. Navigate to [http://localhost:3000/posts/new](http://localhost:3000/posts/new) and you'll see another routing error:
+With the route defined, requests can now be made to `/posts/new` in the application. Navigate to <http://localhost:3000/posts/new> and you'll see another routing error:
![Another routing error, uninitialized constant PostsController](images/getting_started/routing_error_no_controller.png)
@@ -289,7 +289,7 @@ end
A controller is simply a class that is defined to inherit from `ApplicationController`. It's inside this class that you'll define methods that will become the actions for this controller. These actions will perform CRUD operations on the posts within our system.
-If you refresh [http://localhost:3000/posts/new](http://localhost:3000/posts/new) now, you'll get a new error:
+If you refresh <http://localhost:3000/posts/new> now, you'll get a new error:
![Unknown action new for PostsController!](images/getting_started/unknown_action_new_for_posts.png)
@@ -302,7 +302,7 @@ def new
end
```
-With the `new` method defined in `PostsController`, if you refresh [http://localhost:3000/posts/new](http://localhost:3000/posts/new) you'll see another error:
+With the `new` method defined in `PostsController`, if you refresh <http://localhost:3000/posts/new> you'll see another error:
![Template is missing for posts/new](images/getting_started/template_is_missing_posts_new.png)
@@ -330,7 +330,7 @@ Go ahead now and create a new file at `app/views/posts/new.html.erb` and write t
<h1>New Post</h1>
```
-When you refresh [http://localhost:3000/posts/new](http://localhost:3000/posts/new) you'll now see that the page has a title. The route, controller, action and view are now working harmoniously! It's time to create the form for a new post.
+When you refresh <http://localhost:3000/posts/new> you'll now see that the page has a title. The route, controller, action and view are now working harmoniously! It's time to create the form for a new post.
### The first form
@@ -579,7 +579,7 @@ content:
```
Finally, if you now go to
-[http://localhost:3000/posts/new](http://localhost:3000/posts/new) you'll
+<http://localhost:3000/posts/new> you'll
be able to create a post. Try it!
![Show action for posts](images/getting_started/show_action_for_posts.png)
@@ -756,7 +756,7 @@ Notice that inside the `create` action we use `render` instead of `redirect_to`
returns `false`. The `render` method is used so that the `@post` object is passed back to the `new` template when it is rendered. This rendering is done within the same request as the form submission, whereas the `redirect_to` will tell the browser to issue another request.
If you reload
-[http://localhost:3000/posts/new](http://localhost:3000/posts/new) and
+<http://localhost:3000/posts/new> and
try to save a post without a title, Rails will send you back to the
form, but that's not very useful. You need to tell the user that
something went wrong. To do that, you'll modify
@@ -1037,7 +1037,7 @@ Then do the same for the `app/views/posts/edit.html.erb` view:
<%= link_to 'Back', :action => :index %>
```
-Point your browser to [http://localhost:3000/posts/new](http://localhost:3000/posts/new) and
+Point your browser to <http://localhost:3000/posts/new> and
try creating a new post. Everything still works. Now try editing the
post and you'll receive the following error: