LoginSignup
1
0

More than 3 years have passed since last update.

[Rails]DRYに書きたい(可読性、保守性)

Posted at

[Rails]似たようなコードを1つにまとめたい(パーシャル)
https://railstutorial.jp/chapters/filling_in_the_layout?version=5.1#sec-partials

[Rails]DRYなコードを書きたいが、一部分が違う場合
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-edit_form

[Rails]タイトルの可変要素をDRYする
https://railstutorial.jp/chapters/static_pages?version=5.1#sec-layouts_and_embedded_ruby
https://qiita.com/shumpeism/items/a0ad5930fa3bc0d24c70

[Rails]汎用性があるので異なるControllerでも定義したメソッドを使いたい
継承→application_controller.rb
https://railstutorial.jp/chapters/user_microposts?version=5.1#sec-micropost_access_control

[Rails]記法一覧
https://qiita.com/gakkie/items/3afcd505c786364aa5fa
https://blog.mothule.com/ruby/ruby-percent-syntax

[Ruby]記法一覧
https://railstutorial.jp/chapters/rails_flavored_ruby?version=5.1#cha-rails_flavored_ruby

[Rails]キーワード引数とオプション引数の違い
https://railstutorial.jp/chapters/updating_and_deleting_users?version=5.1#sec-users_index

Railsが暗黙的にやってくれること一覧
Railsは慣習に従って、アクションに対応するビューを暗黙的に呼び出します。例えば、showアクションの最後でshow.html.erbを呼び出す、といった具合です。

その他
[Rails]rails sがバックグラウンドにあり、ctrl+cで消せない場合
https://qiita.com/kanuu/items/fd6e33fca6ad6a90d059

[Rails]ユニーク制約とは?どんなメリットがある?

[Rails]シンボルを使うタイミング
https://uxmilk.jp/25934

[Rails]attr_accessor とは?
http://bryankawa.hatenablog.com/entry/2017/01/28/150537

非同期で通信がしたい→Ajax,JS
https://railstutorial.jp/chapters/following_users?version=5.1#sec-a_working_follow_button_with_ajax

1
0
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
0