Things you should avoid when you use Ruby on Rails

1. N+1 Query

2. Functions that are too ruby specific

3. Overriding Ruby/Rails native implementation

4. Too many instance variables inside controller

def popular_post
@cache_post||=Post.all.popular
end

5. User-defined field names

= simple_form_for @user do |f|
-f.object.user_defined_fields.each do |udf|
=f.input udf.to_sym
=f.button :submit

6. Hack the tools as permanent solution

7. Guess the use of less frequently used functions

--

--

--

Let's go invent tomorrow instead of worrying about what happened yesterday.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to setup a kubernetes cluster in under 15 mins using k3s? — Home Lab Part 4

Web Automation: Selenium WebDriver and Python — Getting Started — Part 2

CS 373 Spring 2021: Final Entry

Programming Question: Knuth-Morris-Pratt Algorithm for String Search (Continued/Final)

how to make professional website using HTML and CSS (Part 1)

SSL pinning or Certificate Pinning

Clean Up Your Code:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam00

Adam00

Let's go invent tomorrow instead of worrying about what happened yesterday.

More from Medium

All the Code I Didn’t Write

Saving Time With Active Record

How to use Devise with turbo in Rails 7

Abstract Classes and Why We Use Them with Active Record in Our Rails Application