1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Rails]Controller系

Last updated at Posted at 2021-01-21

[Rails]フォームの入力に失敗した時の実装
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-unsuccessful_edits

[Rails]Railsのredirect_toにおける_pathと_urlの使い分け(同じようなもの)
https://teratail.com/questions/204077

[Rails]部分テンプレートを呼び出したい
render ‘ファイル名’
https://pikawaka.com/rails/render

[Rails]Destroyアクションとセキュリティ
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-the_destroy_action

[Rails]newとbuildの違い
newメソッドとbuildメソッドはともにインスタンスを生成するが、
buildは自動的にuser_idをセットしてインスタンスを生成することができる。
https://qiita.com/Kaisyou/items/8876f39e12631f4e5154

[Rails]CRUD(Create)
https://railstutorial.jp/chapters/sign_up?version=5.1#sec-signup_form

[Rails]CRUD(Read)
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-showing_all_users

[Rails]CRUD(Destroy)
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-the_destroy_action

[Rails]なぜ、HTMLフォームにcreateやdestroyのmethodが記載されてないのに、createされたりdestroyされるの?

①URLリクエストをroutesに送る。
②そこで該当コントローラーの該当アクションに指示が行き、そこで事前に自らが記載したcreateやdestroyの処理を行う。
自ら描く事もあれば、resourseで自動で書いてくれる人もいる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?