Files
danbooru/app/logical/routes.rb
evazion dbb66ace90 routes: replace hardcoded routes in models with route helpers.
Add a Routes module that gives models access to route helpers outside of
views, and use it to replace various hardcoded routes.
2020-12-24 00:17:19 -06:00

12 lines
264 B
Ruby

# Allow Rails URL helpers to be used outside of views.
# Example: Routes.posts_path(tags: "touhou") => /posts?tags=touhou
class Routes
include Singleton
include Rails.application.routes.url_helpers
class << self
delegate_missing_to :instance
end
end