Forum: Ruby on Rails [3.2] route issue w root url displayed

Posted by Kad Kerforn (kadoudal)
on 2012-11-22 12:16
(Received via mailing list)
my app has scoped routes  :

MyApp::Application.routes.draw do

  scope "/:locale" do
   .....
   ....
  end

  root :to => "cms_content#render_html", :defaults => { :locale =>
I18n.locale }
end

 I also have an helper  to preset the locale for all my routes :

  def default_url_options(options={})
    { :locale => I18n.locale }
  end
so all urls are generated like : 
http://www.mydomain.com/en/users
 ...

but for the root url
it generates  :
 http://www.mydomain.com/?locale=en
which is correctly handled by my app , but not so nice displayed ..

I'd prefer to see the root url being  : 
http://www.mydomain.com/en/

is there anyway to get it  ?
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.