A JavaScript developer's guide to Rails: Where Does Everything Come From?
thoughtbot.com·1d
🔧Code Generation
Preview
Report Post

As a senior JavaScript developer learning Rails, you’ve probably felt this frustration: you’re reading Rails code and suddenly come across a method like current_user, redirect_to, or belongs_to, and you have no idea where it originated. There’s no import statement. No require. It’s just… there.

Coming from JavaScript’s explicit world of imports and modules, Rails can feel like programming in a house of mirrors. Everything seems to appear out of thin air. This magical appearance was one of my biggest struggles too, so I want to demystify where everything actually comes from.

The Fundamental Difference: JavaScript vs Rails

In modern JavaScript, if you want to use something, you import it:

import { useState } from 'r...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help