lib/avo/app.rb in avo-2.9.1.pre3 vs lib/avo/app.rb in avo-2.9.1.pre4
- old
+ new
@@ -27,15 +27,19 @@
else
self.cache_store = Rails.cache
end
end
- def init(request:, context:, current_user:, root_path:, view_context:, params:)
+ # Renerate a dynamic root path using the URIService
+ def root_path(paths: [], **args)
+ Avo::Services::URIService.parse(view_context.avo.root_url.to_s).append_paths(paths).to_s
+ end
+
+ def init(request:, context:, current_user:, view_context:, params:)
self.error_messages = []
self.request = request
self.context = context
self.current_user = current_user
- self.root_path = root_path
self.view_context = view_context
self.params = params
self.license = Licensing::LicenseManager.new(Licensing::HQ.new(request).response).license
self.translation_enabled = license.has(:localization)