---
---

### Generate model and migration

```bash
rails generate model Article title:string text:text
```

### Perform the migration

```bash
rails db:migrate
```

### Save the data in the controller
```ruby
class ArticlesController < ApplicationController
  def show
    @article = Article.find(params[:id])
  end

  def new
  end

  def create
    @article = Article.new(article_params)

    @article.save
    redirect_to @article
  end

  private
  def article_params
    params.require(:article).permit(:title, :text)
  end
end
```

### View template
```html
<p>
  <strong>Title:</strong>
  <%= @article.title %>
</p>

<p>
  <strong>Text:</strong>
  <%= @article.text %>
</p>
```

Add ruby on rails notes: saving data
Add ruby on rails notes: saving data
