aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/getting_started.md
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2012-09-02 14:52:12 -0400
committerPrem Sichanugrist <s@sikac.hu>2012-09-17 15:54:23 -0400
commit2e89ac34cf25d1045dcef50d1a03dd84fb37d739 (patch)
tree51344096ba654d353eae8dc3503d874b3d9f81f7 /guides/source/getting_started.md
parent2c38567646791f223b4e48550fba0e0386a05d96 (diff)
downloadrails-2e89ac34cf25d1045dcef50d1a03dd84fb37d739.tar.gz
rails-2e89ac34cf25d1045dcef50d1a03dd84fb37d739.tar.bz2
rails-2e89ac34cf25d1045dcef50d1a03dd84fb37d739.zip
Convert image tags to Markdown syntax
Diffstat (limited to 'guides/source/getting_started.md')
-rw-r--r--guides/source/getting_started.md24
1 files changed, 12 insertions, 12 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 52fd2b8ca0..44e66e2d9a 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -157,7 +157,7 @@ TIP: Compiling CoffeeScript to JavaScript requires a JavaScript runtime and the
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:
-!images/rails_welcome.png(Welcome Aboard screenshot)!
+![Welcome Aboard screenshot](images/rails_welcome.png)
TIP: To stop the web server, hit Ctrl+C in the terminal window where it's running. In development mode, Rails does not generally require you to restart the server; changes you make in files will be automatically picked up by the server.
@@ -251,7 +251,7 @@ In the Blog application, you will now create a new _resource_. A resource is the
In the next section, you will add the ability to create new posts in your application and be able to view them. This is the "C" and the "R" from CRUD: creation and reading. The form for doing this will look like this:
-!images/getting_started/new_post.png(The new post form)!
+![The new post form](images/getting_started/new_post.png)
It will look a little basic for now, but that's ok. We'll look at improving the styling for it afterwards.
@@ -259,7 +259,7 @@ It will look a little basic for now, but that's ok. We'll look at improving the
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:
-!images/getting_started/routing_error_no_route_matches.png(A routing error, no route matches /posts/new)!
+![A routing error, no route matches /posts/new](images/getting_started/routing_error_no_route_matches.png)
This is because there is nowhere inside the routes for the application -- defined inside `config/routes.rb` -- that defines this route. By default, Rails has no routes configured at all, besides the root route you defined earlier, and so you must define your routes as you need them.
@@ -273,7 +273,7 @@ This route is a super-simple route: it defines a new route that only responds to
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:
-!images/getting_started/routing_error_no_controller.png(Another routing error, uninitialized constant PostsController)!
+![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:
@@ -292,7 +292,7 @@ A controller is simply a class that is defined to inherit from `ApplicationContr
If you refresh [http://localhost:3000/posts/new](http://localhost:3000/posts/new) now, you'll get a new error:
-!images/getting_started/unknown_action_new_for_posts.png(Unknown action new for PostsController!)!
+![Unknown action new for PostsController!](images/getting_started/unknown_action_new_for_posts.png)
This error indicates that Rails cannot find the `new` action inside the `PostsController` that you just generated. This is because when controllers are generated in Rails they are empty by default, unless you tell it you wanted actions during the generation process.
@@ -305,7 +305,7 @@ 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:
-!images/getting_started/template_is_missing_posts_new.png(Template is missing for posts/new)!
+![Template is missing for posts/new](images/getting_started/template_is_missing_posts_new.png)
You're getting this error now because Rails expects plain actions like this one to have views associated with them to display their information. With no view available, Rails errors out.
@@ -387,7 +387,7 @@ By using the `post` method rather than the `get` method, Rails will define a rou
With the form and its associated route defined, you will be able to fill in the form and then click the submit button to begin the process of creating a new post, so go ahead and do that. When you submit the form, you should see a familiar error:
-!images/getting_started/unknown_action_create_for_posts.png(Unknown action create for PostsController)!
+![Unknown action create for PostsController](images/getting_started/unknown_action_create_for_posts.png)
You now need to create the `create` action within the `PostsController` for this to work.
@@ -584,7 +584,7 @@ Finally, if you now go to
[http://localhost:3000/posts/new](http://localhost:3000/posts/new) you'll
be able to create a post. Try it!
-!images/getting_started/show_action_for_posts.png(Show action for posts)!
+![Show action for posts](images/getting_started/show_action_for_posts.png)
### Listing all posts
@@ -814,7 +814,7 @@ standout.
Now you'll get a nice error message when saving a post without title when you
attempt to do just that on the [new post form(http://localhost:3000/posts/new)](http://localhost:3000/posts/new).
-!images/getting_started/form_with_errors.png(Form With Errors)!
+![Form With Errors](images/getting_started/form_with_errors.png)
### Updating Posts
@@ -1166,7 +1166,7 @@ This is done via the JavaScript file `jquery_ujs` which is automatically include
into your application's layout (`app/views/layouts/application.html.erb`) when you
generated the application. Without this file, the confirmation dialog box wouldn't appear.
-!images/getting_started/confirm_dialog.png(Confirm Dialog)!
+![Confirm Dialog](images/getting_started/confirm_dialog.png)
Congratulations, you can now create, show, list, update and destroy
posts. In the next section will see how Rails can aid us when creating
@@ -1497,7 +1497,7 @@ template. This is where we want the comment to show, so let's add that to the
Now you can add posts and comments to your blog and have them show up in the
right places.
-!images/getting_started/post_with_comments.png(Post with Comments)!
+![Post with Comments](images/getting_started/post_with_comments.png)
Refactoring
-----------
@@ -1731,7 +1731,7 @@ class CommentsController < ApplicationController
Now if you try to create a new post, you will be greeted with a basic HTTP
Authentication challenge
-!images/challenge.png(Basic HTTP Authentication Challenge)!
+![Basic HTTP Authentication Challenge](images/challenge.png)
What's Next?
------------