Skip to content

Instantly share code, notes, and snippets.

@akirill0v
Created November 8, 2013 13:25
Show Gist options
  • Save akirill0v/7371004 to your computer and use it in GitHub Desktop.
Save akirill0v/7371004 to your computer and use it in GitHub Desktop.
scope "(:locale)" do
root_to "welcome#index"
end
rake routes
web/welcome#index root /(:locale)(.:format)
# Вроде все ок
# Но если я захочу добавить еще один скоуп
scope "(:locale)" do
scope "(:language)" do
root_to "welcome#index"
end
end
rake routes
web/welcome#index root (/:locale)(/:language)(.:format) - первый слеш переходит в небязательный параметр
и в таком случае запрос на "/" будет падать с ошибкой "Путь не найден"
root_path # => ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment