Simplifying Data with Rails Single Table Inheritance

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • When you build apps with Ruby on Rails, managing a lot of data can be tricky, especially when different parts of your app are similar but not the same.
    Rails has a cool feature called Single Table Inheritance (STI) that helps with this. This post explores how to use Rails' single table inheritance, why it's helpful, and other options you might consider if you’re not the biggest fan.
    📕 Read the full blog post here: webcrunch.com/...
    ======
    👋 I'm Andy Leverenz, a passionate product designer and developer. I love creating and sharing my knowledge through design, coding, and writing. Join me on my journey by checking out my blog, Web-Crunch (webcrunch.com), where I publish tutorials, articles, and the occasional vlog about design and development.
    📰 Never miss an update! Click here to subscribe: www.youtube.co...
    💻 Read the written version:
    web-crunch.com...
    💎 New to Ruby on Rails? Enroll in my course HELLO RAILS:
    hellorails.io
    💻 The Blog (my source of truth): webcrunch.com
    Additional Links:
    🎨 Bring life to Rails projects with Rails UI: railsui.com.
    👨‍💻 Hire me: Visit: railsui.com/cu...
    🐤 / webcrunchblog .
    ⚙️ github.com/jus....
    P.S. This stuff takes a long time to make but I love to do it. To help me keep at it consider supporting me. If not monetarily, subscribe to the channel or share it with someone!
    ✨ github.com/spo...
    ☕️ www.buymeacoff...

КОМЕНТАРІ • 5

  • @baowarrior4892
    @baowarrior4892 4 місяці тому +1

    Nice! Thanks for sharing!

  • @divyanshu.sharma1401
    @divyanshu.sharma1401 3 місяці тому

    Thanks for the video. Please add a video where we add fields which are not common to all the models

  • @mikopiko
    @mikopiko 4 місяці тому +1

    Cool

  • @meshu_amare
    @meshu_amare 4 місяці тому +1

    I love it thanks for sharing but my question is, do we must have type attribute to use STI? I mean how the model understand type as a Car?
    Thanks

    • @Webcrunch
      @Webcrunch  4 місяці тому

      Yes, you need the type attribute 👍