using url_for in a lib folder module

后端 未结 2 1428
你的背包
你的背包 2021-02-13 02:58

I have a model with a field called \"type\" and a field called \"value\". The type field will determine how the \"value\" is parsed before rendering. I want this to be easily ex

2条回答
  •  悲哀的现实
    2021-02-13 03:06

    Victory!

    include ActionView::Helpers
    include ActionDispatch::Routing
    include Rails.application.routes.url_helpers
    

    via http://apidock.com/rails/ActionController/UrlWriter

提交回复
热议问题