Pretty simple, I want to use the polymorphic_path method inside the Rails 4 model. Yes, I know this is a bad separation of problems. And I know about Rails.application.routes.url_helpers , but the polymorphic_path is not there.
polymorphic_path
Rails.application.routes.url_helpers
Try including PolymorphicRoutes as well:
PolymorphicRoutes
include ActionDispatch::Routing::PolymorphicRoutes include Rails.application.routes.url_helpers def link polymorphic_path(self) end
Source: https://habr.com/ru/post/978352/More articles:Is there a way to back up Visual Studio Team Services projects? - version-controlFile upload control does not work on Facebook. Browser in the application - facebookCompare two arrays with Perl - perlIs there a way to get the whole license header from Cocoapods - iosThe fastest matrix determinant calculation algorithm? - algorithmdrawBitmap: How can you set the coordinates and use the matrix? - androidHow to use polyorphic_path in lib / module in Rails 4 - ruby-on-railsHow to upload content to a lightbox overlay - jqueryScaling and translating a bitmap in android - androidangularjs UI bootstrap modal with google sites - angularjsAll Articles