lib/avo/app.rb in avo-2.9.2.pre1 vs lib/avo/app.rb in avo-2.10.0
- old
+ new
@@ -27,17 +27,24 @@
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: [], query: {}, **args)
+ Avo::Services::URIService.parse(view_context.avo.root_url.to_s)
+ .append_paths(paths)
+ .append_query(query)
+ .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.request = request
+ self.view_context = view_context
self.license = Licensing::LicenseManager.new(Licensing::HQ.new(request).response).license
self.translation_enabled = license.has(:localization)
# Set the current host for ActiveStorage