Skip to main content

Command Palette

Search for a command to run...

Rails Notes Explained

Published
1 min read
P

I am a full-stack Ruby on Rails developer with experience in PostgreSQL, Docker, Heroku, and performance optimization. I love exploring new technology stacks and have recently developed an interest in mobile app development using Flutter. My skills in test-driven development and fixing security vulnerabilities have helped me deliver high-quality, reliable code. I am also currently learning about machine learning and its applications in real-world problem-solving. I bring a unique combination of technical expertise, creative problem-solving, and a passion for learning to any team. I am committed to delivering elegant and efficient software solutions and excited to contribute to an innovative and dynamic team that shares this vision.

In this post you will learn how to list down all of your todos, fixme, optimize tags from the rails project.

In your rails project if you run rake notes (you can also use rails notes in rails 5+ projects) in your terminal, it will search for comments beginning with a specific keyword and it will print you the filename and line number for your:

For example, we have given controller with comments

class PostsController < ApplicationController
  before_action :set_post, only: %i[ show edit update destroy ]

  # TODO: Write a testcase for index action
  def index
    @posts = Post.all
  end

  # OPTIMIZE: Show action is taking too much memory, optimize it
  def show
  end

  # FIXME: new action has bad code, refactor it!
  def new
    @post = Post.new
  end
end

and if we run rails notes

> rails notes
app/controllers/posts_controller.rb:
  * [ 5] [TODO] Write a testcase for index action
  * [11] [OPTIMIZE] show action is taking too much memory, optimize it
  * [15] [FIXME] new action have bad code, refactor it!

More Info

More from this blog

T

The Developers Journey

41 posts

I am a full-stack Ruby on Rails developer with experience in TDD, PostgreSQL, Docker, Heroku, performance optimization and Flutter mobile app development.