Skip to content

Instantly share code, notes, and snippets.

View zcserei's full-sized avatar
🚀

Cserei Zoltán zcserei

🚀
View GitHub Profile
@mehdi-farsi
mehdi-farsi / habtm_hmt.md
Last active February 5, 2023 10:32
Replace HABTM by HMT with Join Table as Model

Has And Belongs To Many (use case)

how it works ?

Let's take the simple example of a blog with:

  • A post habtm tags
  • A tag habtm posts

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world