Permalink
Browse files

Convert all the links into Markdown format

  • Loading branch information...
sikachu committed Sep 2, 2012
1 parent 31ef4cf commit 9873dd800b77105fe17f583f0d036240ef334826
@@ -18,11 +18,11 @@ What Does a Controller Do?
Action Controller is the C in MVC. After routing has determined which controller to use for a request, your controller is responsible for making sense of the request and producing the appropriate output. Luckily, Action Controller does most of the groundwork for you and uses smart conventions to make this as straightforward as possible.
-For most conventional "RESTful":http://en.wikipedia.org/wiki/Representational_state_transfer applications, the controller will receive the request (this is invisible to you as the developer), fetch or save data from a model and use a view to create HTML output. If your controller needs to do things a little differently, that's not a problem, this is just the most common way for a controller to work.
+For most conventional [RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer) applications, the controller will receive the request (this is invisible to you as the developer), fetch or save data from a model and use a view to create HTML output. If your controller needs to do things a little differently, that's not a problem, this is just the most common way for a controller to work.
A controller can thus be thought of as a middle man between models and views. It makes the model data available to the view so it can display that data to the user, and it saves or updates data from the user to the model.
-NOTE: For more details on the routing process, see "Rails Routing from the Outside In":routing.html.
+NOTE: For more details on the routing process, see [Rails Routing from the Outside In](routing.html).
Methods and Actions
-------------------
@@ -44,7 +44,7 @@ def new
end
```
-The "Layouts & Rendering Guide":layouts_and_rendering.html explains this in more detail.
+The [Layouts & Rendering Guide](layouts_and_rendering.html) explains this in more detail.
`ApplicationController` inherits from `ActionController::Base`, which defines a number of helpful methods. This guide will cover some of these, but if you're curious to see what's in there, you can see all of them in the API documentation or in the source itself.
@@ -138,7 +138,7 @@ And assume that you're sending the data to `CompaniesController`, it would then
{ :name => "acme", :address => "123 Carrot Street", :company => { :name => "acme", :address => "123 Carrot Street" }}
```
-You can customize the name of the key or specific parameters you want to wrap by consulting the "API documentation":http://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html
+You can customize the name of the key or specific parameters you want to wrap by consulting the [API documentation](http://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html)
### Routing Parameters
@@ -185,7 +185,7 @@ The CookieStore can store around 4kB of data -- much less than the others -- but
If your user sessions don't store critical data or don't need to be around for long periods (for instance if you just use the flash for messaging), you can consider using ActionDispatch::Session::CacheStore. This will store sessions using the cache implementation you have configured for your application. The advantage of this is that you can use your existing cache infrastructure for storing sessions without requiring any additional setup or administration. The downside, of course, is that the sessions will be ephemeral and could disappear at any time.
-Read more about session storage in the "Security Guide":security.html.
+Read more about session storage in the [Security Guide](security.html).
If you need a different session storage mechanism, you can change it in the `config/initializers/session_store.rb` file:
@@ -285,7 +285,7 @@ To reset the entire session, use `reset_session`.
The flash is a special part of the session which is cleared with each request. This means that values stored there will only be available in the next request, which is useful for passing error messages etc.
-It is accessed in much the same way as the session, as a hash (it's a "FlashHash":http://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html instance).
+It is accessed in much the same way as the session, as a hash (it's a [FlashHash](http://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html) instance).
Let's use the act of logging out as an example. The controller can send a message which will be displayed to the user on the next request:
@@ -567,11 +567,11 @@ You will see how the token gets added as a hidden field:
</form>
```
-Rails adds this token to every form that's generated using the "form helpers":form_helpers.html, so most of the time you don't have to worry about it. If you're writing a form manually or need to add the token for another reason, it's available through the method `form_authenticity_token`:
+Rails adds this token to every form that's generated using the [form helpers](form_helpers.html), so most of the time you don't have to worry about it. If you're writing a form manually or need to add the token for another reason, it's available through the method `form_authenticity_token`:
The `form_authenticity_token` generates a valid authentication token. That's useful in places where Rails does not add it automatically, like in custom Ajax calls.
-The "Security Guide":security.html has more about this and a lot of other security-related issues that you should be aware of when developing a web application.
+The [Security Guide](security.html) has more about this and a lot of other security-related issues that you should be aware of when developing a web application.
The Request and Response Objects
--------------------------------
@@ -580,7 +580,7 @@ In every controller there are two accessor methods pointing to the request and t
### The `request` Object
-The request object contains a lot of useful information about the request coming in from the client. To get a full list of the available methods, refer to the "API documentation":http://api.rubyonrails.org/classes/ActionDispatch/Request.html. Among the properties that you can access on this object are:
+The request object contains a lot of useful information about the request coming in from the client. To get a full list of the available methods, refer to the [API documentation](http://api.rubyonrails.org/classes/ActionDispatch/Request.html). Among the properties that you can access on this object are:
|_.Property of `request`|_.Purpose|
|host|The hostname used for this request.|
@@ -822,7 +822,7 @@ class ClientsController < ApplicationController
end
```
-NOTE: Certain exceptions are only rescuable from the `ApplicationController` class, as they are raised before the controller gets initialized and the action gets executed. See Pratik Naik's "article":http://m.onkey.org/2008/7/20/rescue-from-dispatching on the subject for more information.
+NOTE: Certain exceptions are only rescuable from the `ApplicationController` class, as they are raised before the controller gets initialized and the action gets executed. See Pratik Naik's [article](http://m.onkey.org/2008/7/20/rescue-from-dispatching) on the subject for more information.
Force HTTPS protocol
--------------------
@@ -49,7 +49,7 @@ The complete HTML returned to the client is composed of a combination of this ER
Using Action View outside of Rails
----------------------------------
-Action View works well with Action Record, but it can also be used with other Ruby tools. We can demonstrate this by creating a small "Rack":http://rack.rubyforge.org/ application that includes Action View functionality. This may be useful, for example, if you'd like access to Action View's helpers in a Rack application.
+Action View works well with Action Record, but it can also be used with other Ruby tools. We can demonstrate this by creating a small [Rack](http://rack.rubyforge.org/) application that includes Action View functionality. This may be useful, for example, if you'd like access to Action View's helpers in a Rack application.
Let's start by ensuring that you have the Action Pack and Rack gems installed:
@@ -83,7 +83,7 @@ TODO needs a screenshot? I have one - not sure where to put it.
Notice how 'hello world' has been converted into 'Hello World' by the `titleize` helper method.
-Action View can also be used with "Sinatra":http://www.sinatrarb.com/ in the same way.
+Action View can also be used with [Sinatra](http://www.sinatrarb.com/) in the same way.
Let's start by ensuring that you have the Action Pack and Sinatra gems installed:
@@ -408,7 +408,7 @@ The following is only a brief overview summary of the helpers available in Actio
### ActiveRecordHelper
-The Active Record Helper makes it easier to create forms for records kept in instance variables. You may also want to review the "Rails Form helpers guide":form_helpers.html.
+The Active Record Helper makes it easier to create forms for records kept in instance variables. You may also want to review the [Rails Form helpers guide](form_helpers.html).
#### error_message_on
@@ -1603,4 +1603,4 @@ end
Then you could create special views like `app/views/posts/show.expert.html.erb` that would only be displayed to expert users.
-You can read more about the Rails Internationalization (I18n) API "here":i18n.html.
+You can read more about the Rails Internationalization (I18n) API [here](i18n.html).
@@ -14,7 +14,7 @@ This guide is an introduction to Active Record. After reading this guide we hope
What is Active Record?
----------------------
-Active Record is the M in "MVC":getting_started.html#the-mvc-architecture - the model - which is the layer of the system responsible for representing business data and logic. Active Record facilitates the creation and use of business objects whose data requires persistent storage to a database. It is an implementation of the Active Record pattern which itself is a description of an Object Relational Mapping system.
+Active Record is the M in [MVC](getting_started.html#the-mvc-architecture) - the model - which is the layer of the system responsible for representing business data and logic. Active Record facilitates the creation and use of business objects whose data requires persistent storage to a database. It is an implementation of the Active Record pattern which itself is a description of an Object Relational Mapping system.
### The Active Record Pattern
@@ -59,16 +59,16 @@ By default, Active Record uses some naming conventions to find out how the mappi
Active Record uses naming conventions for the columns in database tables, depending on the purpose of these columns.
* *Foreign keys* - These fields should be named following the pattern `singularized_table_name_id` (e.g., `item_id`, `order_id`). These are the fields that Active Record will look for when you create associations between your models.
-* *Primary keys* - By default, Active Record will use an integer column named `id` as the table's primary key. When using "Rails Migrations":migrations.html to create your tables, this column will be automatically created.
+* *Primary keys* - By default, Active Record will use an integer column named `id` as the table's primary key. When using [Rails Migrations](migrations.html) to create your tables, this column will be automatically created.
There are also some optional column names that will create additional features to Active Record instances:
* `created_at` - Automatically gets set to the current date and time when the record is first created.
* `created_on` - Automatically gets set to the current date when the record is first created.
* `updated_at` - Automatically gets set to the current date and time whenever the record is updated.
* `updated_on` - Automatically gets set to the current date whenever the record is updated.
-* `lock_version` - Adds "optimistic locking":http://api.rubyonrails.org/classes/ActiveRecord/Locking.html to a model.
-* `type` - Specifies that the model uses "Single Table Inheritance":http://api.rubyonrails.org/classes/ActiveRecord/Base.html
+* `lock_version` - Adds [optimistic locking](http://api.rubyonrails.org/classes/ActiveRecord/Locking.html) to a model.
+* `type` - Specifies that the model uses [Single Table Inheritance](http://api.rubyonrails.org/classes/ActiveRecord/Base.html)
* `(table_name)_count` - Used to cache the number of belonging objects on associations. For example, a `comments_count` column in a `Post` class that has many instances of `Comment` will cache the number of existent comments for each post.
NOTE: While these column names are optional, they are in fact reserved by Active Record. Steer clear of reserved keywords unless you want the extra functionality. For example, `type` is a reserved keyword used to designate a table using Single Table Inheritance (STI). If you are not using STI, try an analogous keyword like "context", that may still accurately describe the data you are modeling.
@@ -190,7 +190,7 @@ Active Record provides a rich API for accessing data within a database. Below ar
users = User.where(:name => 'David', :occupation => 'Code Artist').order('created_at DESC')
```
-You can learn more about querying an Active Record model in the "Active Record Query Interface":"active_record_querying.html" guide.
+You can learn more about querying an Active Record model in the [Active Record Query Interface](active_record_querying.html) guide.
### Update
@@ -214,14 +214,14 @@ Likewise, once retrieved an Active Record object can be destroyed which removes
Validations
-----------
-Active Record allows you to validate the state of a model before it gets written into the database. There are several methods that you can use to check your models and validate that an attribute value is not empty, is unique and not already in the database, follows a specific format and many more. You can learn more about validations in the "Active Record Validations and Callbacks guide":active_record_validations_callbacks.html#validations-overview.
+Active Record allows you to validate the state of a model before it gets written into the database. There are several methods that you can use to check your models and validate that an attribute value is not empty, is unique and not already in the database, follows a specific format and many more. You can learn more about validations in the [Active Record Validations and Callbacks guide](active_record_validations_callbacks.html#validations-overview).
Callbacks
---------
-Active Record callbacks allow you to attach code to certain events in the life-cycle of your models. This enables you to add behavior to your models by transparently executing code when those events occur, like when you create a new record, update it, destroy it and so on. You can learn more about callbacks in the "Active Record Validations and Callbacks guide":active_record_validations_callbacks.html#callbacks-overview.
+Active Record callbacks allow you to attach code to certain events in the life-cycle of your models. This enables you to add behavior to your models by transparently executing code when those events occur, like when you create a new record, update it, destroy it and so on. You can learn more about callbacks in the [Active Record Validations and Callbacks guide](active_record_validations_callbacks.html#callbacks-overview).
Migrations
----------
-Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the "Active Record Migrations guide":migrations.html
+Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the [Active Record Migrations guide](migrations.html)
Oops, something went wrong.

0 comments on commit 9873dd8

Please sign in to comment.