2
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 5 years have passed since last update.

Railsで課題となっているソースを抽出する方法(TODO、FIXME、OPTIMIZE)

2
Last updated at Posted at 2017-12-14

あとあと見返した際に、これなんだって時などに使うのがアノテーションというそうです。
コードに# TODOなどと書いておくと後で一括で抽出できるので、リリース前とかに確認すると良いかもですね。

# controller
class ApplicationController < ActionController::Base
# TODO コントラーラーです。
  def show_image
  end
end


# model
class Message < ApplicationRecord
  belongs_to :topic
  # TODO モデルです。
end


# view
<% #TODO ビューです %> #<%=とするとダメっぽいです。
<div class="row">
  <h1>テスト</h1>
</div>
$ rails notes
app/controllers/application_controller.rb:
  * [4] [TODO] コントラーラーです。

app/models/message.rb:
  * [4] [TODO] モデルです。

app/views/topics/new.html.erb:
  * [1] [TODO] ビューです

それぞれの単語の意味は、こんな感じだそうです。

  • TODO:やらなければならないこと
  • FIXME:ここ誰か直して
  • OPTIMIZE:最適化が必要

参考にさせていただいたサイト
https://permanent-til-me.ssl-netowl.jp/archives/1184

2
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
2
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?