Polymorphic Routes in Rails - in views

前端 未结 4 855
执念已碎
执念已碎 2021-01-15 03:19

I have Comment as a polymorphic model.

It is attached to Post, Review, etc.

I also have an action in CommentsController, called test.

I

4条回答
  •  天涯浪人
    2021-01-15 03:32

    I decided to just use an if statement in the view, based on if the current action was present, such as if @post or if @review

提交回复
热议问题