What path is a mountable engine mounted on

后端 未结 4 1345
故里飘歌
故里飘歌 2021-02-04 14:50

I need to know, from inside of a layout of a mountable engine, what path it\'s currently being mounted on. What would be the way to do it?

E.g. my routes.rb contains the

4条回答
  •  伪装坚强ぢ
    2021-02-04 15:29

    You could simply use the following code to tell what path engine is mount to inside an engine controller/view:

    env["SCRIPT_NAME"] # => "/backend"
    

提交回复
热议问题