How to Add Categories and Filtering (Has Many Through Relationships)

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 15

  • @BrainTrustDigital
    @BrainTrustDigital  3 ปีที่แล้ว +3

    ⏰ Timestamps
    0:00 Introduction
    1:27 Create Git branch
    1:59 Category scaffold
    2:30 Create join table
    3:42 Migrate database
    3:57 Create join model
    4:59 Add relationships
    5:29 Update routes
    7:00 Lock down actions
    9:58 Update form
    11:34 Update strong params
    12:51 Yarn add Select2
    14:38 Data population
    18:04 Minor cleanup
    18:25 Update views
    23:47 Push to GitHub
    25:10 Deploy
    26:32 Verify Production
    26:54 Closing notes

  • @MxSmack
    @MxSmack 2 ปีที่แล้ว +1

    Can't thank you enough for the update strong params section of this video (11:34). I know that params need to be allowed into the controller but could not work out the syntax for an array of IDs and this helped a lot!

    • @BrainTrustDigital
      @BrainTrustDigital  2 ปีที่แล้ว

      Glad that I could help! Please let me know if there are other topics you’d like me to try to cover.

  • @EnjoytheMents
    @EnjoytheMents 3 ปีที่แล้ว +1

    i was strugling with the has_many trough and the permitted params in the form! THANK YOU SO MUCH THIS HELP ME A LOT!!!! Rails ❤️

  • @Matt23353
    @Matt23353 2 ปีที่แล้ว

    Excellent video. Loved that you showed the whole process starting from creating a new GIT branch. Those professional workflows are often left out of other tutorials. Great work!

    • @BrainTrustDigital
      @BrainTrustDigital  2 ปีที่แล้ว +1

      Thank for the kind words. Totally agree , I do get complaints that so videos are longer than they need to be, which I can totally appreciate, but I often got lost in those cracks where one tutorial left off and the next began. As a result I have tried to show more “complete” tutorials. Glad this helped you, please let me know if there are other topics you’d like me to cover.

  • @sebastiana.4905
    @sebastiana.4905 ปีที่แล้ว

    Hello, really great tutorial video, thanks, but I would like to have more context about all, for example is there a repository to watch the entire project or are there video tutorials about the database creation?, and to watch css style is also very appreciated if it is possible, just for those very new programmers 😊

  • @al-mokhtar_
    @al-mokhtar_ 3 ปีที่แล้ว +3

    small question why you populating data from tasks not seeds ? new sub from reddit by the way lol

    • @BrainTrustDigital
      @BrainTrustDigital  3 ปีที่แล้ว +1

      Great question, short answer: data population is probably most appropriate via a seed file, there are some cases where it makes sense via a task -- this video was not one of those cases, the next video I am planning to release actually is a case as I could need to the task in the future.
      The primary reason I would populate data via a task is with any sort of recurring frequency. For example, I need to do this process or service once every day.
      I did so in a task for a couple of reasons, all admittedly fairly trivial. This task will be run a bunch in the future as I add more videos and categories. While its really not a huge deal to constantly run your whole seed file, I developed a preference for being able to call the specific tasks so I don't have to wait for the entire seed file to run. In this case the seed file is extremely small, the seed file (if it were much larger) would get a bit slower though honestly probably negligible time difference.
      Another reason, is to demonstrate a different way to accomplish data population. In this specific case, there was not real ground to stand on for breaking out from the seed file and into a task. In my next video covering counter cache, I create a task where it actually may make sense to do so outside of the seed file as I could potentially run in the future.
      I appreciated the question, as it made me examine the reason behind my choice. I will probably move this task to the seed file. I am also realizing I need to be conscience of my biases so I don't pass on bad habits via my tutorials.

  • @alehunter15
    @alehunter15 3 ปีที่แล้ว +1

    Really enjoyed this one, congrats

    • @BrainTrustDigital
      @BrainTrustDigital  3 ปีที่แล้ว +1

      Thanks so much! I really appreciate the consistent support and feedback

  • @ingemarandrade277
    @ingemarandrade277 3 ปีที่แล้ว +1

    Thanks for this amazing content!

    • @BrainTrustDigital
      @BrainTrustDigital  3 ปีที่แล้ว +1

      No problem! I am glad you liked it. You previously mentioned starting to learn AWS, how has that been going?

    • @ingemarandrade277
      @ingemarandrade277 3 ปีที่แล้ว

      @@BrainTrustDigital yes I started reading AWS docs on how to deploy Rails apps but it was quite hard for me as I needed some initial context.
      I then started searching on TH-cam for tutorials and found nothing relevant until I found this amazing channel who guided me step by step on how to deploy my app using Capistrano!
      Thanks to you I have gained confidence on deploying and managing Rails apps on AWS!
      Greetings from Barcelona!