ruby on rails - Prevent adding locale string for default locale -


i prevent rails adding locale string links if default locale selected.for example, if go directly example.com, link generated helper shoudn't example.com/en/orders (it should example.com/orders).

my application_controlelr.rb contains

 def default_url_options       { locale: i18n.locale }  end 

which assume adds locale links, , routes.rb

scope '(:locale)', locale: /en|es/     resources :orders end 

so, there way stop ?


Comments