> For the complete documentation index, see [llms.txt](https://huang-jason.gitbook.io/ruby-rails-syntax/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huang-jason.gitbook.io/ruby-rails-syntax/chap_4.md).

# chap 4

## Rails: ActiveModel, ActiveRecord and ActiveResource

```
ActiveModel + Database Support = ActiveRecord

ActiveModel via WebService API = AcitveResource
```

**ActiveModel**: all the model related without db. (Ex: validations).

**ActiveRecord**: associates a class to the database. (Ex: find method).

**ActiveResource**: Similar to ActiveRecord. However, instead of being backed by a database, an ActiveResource object is backed by another application through a web service API.

## Rails: Action Pack

```
Action Pack: From request to response -> provides the view and controller layers.
|
|- Action Dispatch: parses request, handles routing, cookies and sessions.
|- Action Controller
```
