The root method is used by default to determine the top level / route. Thus, you define the same route twice, as a result of which the second definition redefines the first!
Here is the root method definition:
def root(options = {})
options = { :to => options } if options.is_a?(String)
match '/', { :as => :root, :via => :get }.merge(options)
end
, : root .
, .
.
scope "/:locale" do
...other routes
root :to => 'home#index', :as => :root_with_locale
end
root :to => 'application#detect_language'
:
root_with_locale_path(:locale => :en)
, !