URIとActionの関係性
| 通信 | Action | 意味 |
|---|---|---|
| get /todos | index | 一覧取得 |
| get /todos/1 | show | 一件取得 |
| get /todos/new | new | 作成画面取得 |
| get /todos/edit | edit | 編集画面取得 |
| post /todos | create | 作成 |
| put(patch) /todos/1 | update | 更新 |
| delete /todos/1 | delete | 削除 |
ブラウザでroutesを確認するURL
http://localhost:3000/rails/info/routes
link_toからcontrollerにパラメータを付与して送る方法
<%= link_to '完了', status_todo_path(todo, ***status: 1***), method: :patch %>
上記のstatus: 1の様に、個別idと一緒にぶち込む。