Rails 5 - using polymorphic associations - rendering the views

后端 未结 1 370
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 03:07

I\'m trying to learn how to use polymorphic associations in my Rails 5 app. I recently asked this question, but I edited it so many times to show all the things I was tryin

相关标签:
1条回答
  • 2021-01-06 03:32

    The answer is here: https://rubyplus.com/articles/3901-Polymorphic-Association-in-Rails-5

    The trick seems to be in the load_commentable method shown in the article. It's too complicated for me to make sense of it, but it works.

    Feeling very grateful for how much help there is from people happy to share what they know. Thank you Taryn & Bala.

    0 讨论(0)
提交回复
热议问题