Controlling routes loading order from Engines

前端 未结 3 418
轻奢々
轻奢々 2020-12-28 08:32

So in Rails3 Engines come with their own models/controllers/views and of course routes. Now the question is: How do you ensure that Engine routes will be loaded before (or a

3条回答
  •  臣服心动
    2020-12-28 08:54

    Having the same issue right now. One other not particularly elegant but safe solution I came up with is adding another engine gem at the end of your gem file, just containing the catch all route, nothing else.

    Edit: Actually, counterintuitively, the routing gem needs to be listed before all other engine gems for its routes to be loaded last.

提交回复
热议问题