Using rails 3.2.13 and spree 2.0.2
I've encountered the similar problem as in Rails mountable engine under a dynamic scope
My routes:
scope ':locale', locale: /en|jp/ do
mount Spree::Core::Engine, at: '/store'
root to: 'home#index'
end
I want to output link to change locale:
<%= link_to 'JP', url_for(locale: :jp) %>
but this outputs:
<a href="/en/store/?locale=jp">JP</a>
instead of expected:
<a href="/jp/store">JP</a>
-- Edit --
When I put to ApplicationController
:
def default_url_options(options={})
{ locale: I18n.locale }
end
it sets locale params in store twice instead of merging them:
http://localhost:3000/en/store/products/bag?locale=en