You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyApp::Application.routes.draw do
scope '(:language)' do
ActiveAdmin.routes(self)
end
end
In my ApplicationsController.rb I have implemented the url_options method like this:
def url_options
{ :language => current_language }.merge(super)
end
The current language shows up fine in the action links (default_actions) but in the main menu the language is ignored causing my site to change language when navigating the menu.
Anyone else experiencing similar problems?
The text was updated successfully, but these errors were encountered:
Seems that MenuItem.generate_url(named_scope) that use Rails.application.routes.url_helpers.send(named_route) doesn't consider url_options or route scopes.
I excluded it from render menu_item.
In method build_menu_item in tabbed_navigation.rb I changed
link_to item.name, item.url
in
link_to item.name, send(item.url)
and in menu_item.rb I changed method url in
def url
@url
end
I think the best solution would be to call the 'send' in a MenuItem, but I do not know how to include the "url helpers" like this:
module ActiveAdmin
class MenuItem
include Module::With::Access::To::ActiveAdmin::UrlHelper
def self.generate_url(named_route)
send(named_route)
end
All my routes are scoped by language like this:
In my ApplicationsController.rb I have implemented the url_options method like this:
The current language shows up fine in the action links (default_actions) but in the main menu the language is ignored causing my site to change language when navigating the menu.
Anyone else experiencing similar problems?
The text was updated successfully, but these errors were encountered: