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
Victory!
include ActionView::Helpers
include ActionDispatch::Routing
include Rails.application.routes.url_helpers
via http://apidock.com/rails/ActionController/UrlWriter
An alternative to url_for you can use Rails.application.routes.url_helpers
just add in route :as
like the following example:
get "sessions/destroy/:param_id", as: :logout
so you can use it as following:
Rails.application.routes.url_helpers.logout_path(:param_id => your_value)
This will do the same as url_for
Hopefully, this would help