{"comment":{"created_at":"2011-10-16T12:38:39Z","body":"Trying to workaround doing this:\r\n\r\n```\r\nlocalized([:de, :'de-CH', :'fr-CH']) do\r\n  match '(:locale/)inserieren' => 'site#advertise', :as => :advertise\r\nend\r\n```\r\n\r\nalso doesn't work, as i18n_routing doesn't add translations for the routes with optional locale param. ","updated_at":"2011-10-16T12:38:39Z","url":"https://api.github.com/repos/kwi/i18n_routing/issues/comments/2420647","id":2420647,"user":{"gravatar_id":"cf3ed91eed72fa093f7e99779135890b","avatar_url":"https://secure.gravatar.com/avatar/cf3ed91eed72fa093f7e99779135890b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ncri","id":16925,"login":"ncri"}},"action":"created","issue":{"number":30,"created_at":"2011-10-16T12:21:28Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"When I do \r\n\r\n```\r\nscope \"(:locale)\", :locale => /(fr-CH)/ do\r\n  localized do\r\n      match '/inserieren' => 'site#advertise', :as => :advertise\r\n  end\r\nend\r\n```\r\n\r\nand then go to /fr-CH/inserieren\r\n\r\nI get this error:\r\n\r\nNoMethodError: undefined method `locale' for #<ActionDispatch::Request:0x007fc222715bb0>\r\n\r\n```\r\n\r\nrack-mount (0.8.3) lib/rack/mount/code_generation.rb:543:in `optimized_each'\r\nrack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'\r\nrack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/routing/route_set.rb:531:in `call'\r\noa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'\r\noa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'\r\noa-core (0.2.6) lib/omniauth/builder.rb:30:in `call'\r\nnewrelic_rpm (3.1.1) lib/new_relic/rack/browser_monitoring.rb:18:in `call'\r\nsass (3.1.7) lib/sass/plugin/rack.rb:54:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'\r\nrack (1.3.2) lib/rack/etag.rb:23:in `call'\r\nrack (1.3.2) lib/rack/conditionalget.rb:25:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/head.rb:14:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/params_parser.rb:21:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/flash.rb:243:in `call'\r\nrack (1.3.2) lib/rack/session/abstract/id.rb:195:in `context'\r\nrack (1.3.2) lib/rack/session/abstract/id.rb:190:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/cookies.rb:326:in `call'\r\nactiverecord (3.1.0) lib/active_record/query_cache.rb:62:in `call'\r\nactiverecord (3.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'\r\nactivesupport (3.1.0) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'\r\nactivesupport (3.1.0) lib/active_support/callbacks.rb:81:in `run_callbacks'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:28:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/reloader.rb:68:in `call'\r\nrack (1.3.2) lib/rack/sendfile.rb:101:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'\r\nrailties (3.1.0) lib/rails/rack/logger.rb:13:in `call'\r\nrack (1.3.2) lib/rack/methodoverride.rb:24:in `call'\r\nrack (1.3.2) lib/rack/runtime.rb:17:in `call'\r\nactivesupport (3.1.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'\r\nrack (1.3.2) lib/rack/lock.rb:15:in `call'\r\nrack-rewrite (1.0.2) lib/rack/rewrite.rb:19:in `call'\r\nactionpack (3.1.0) lib/action_dispatch/middleware/static.rb:53:in `call'\r\nrailties (3.1.0) lib/rails/engine.rb:455:in `call'\r\nrailties (3.1.0) lib/rails/rack/content_length.rb:16:in `call'\r\nrailties (3.1.0) lib/rails/rack/log_tailer.rb:14:in `call'\r\nthin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'\r\nthin (1.2.11) lib/thin/connection.rb:82:in `catch'\r\nthin (1.2.11) lib/thin/connection.rb:82:in `pre_process'\r\nthin (1.2.11) lib/thin/connection.rb:57:in `process'\r\nthin (1.2.11) lib/thin/connection.rb:42:in `receive_data'\r\neventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'\r\neventmachine (0.12.10) lib/eventmachine.rb:256:in `run'\r\nthin (1.2.11) lib/thin/backends/base.rb:61:in `start'\r\nthin (1.2.11) lib/thin/server.rb:159:in `start'\r\nrack (1.3.2) lib/rack/handler/thin.rb:13:in `run'\r\nrack (1.3.2) lib/rack/server.rb:265:in `start'\r\nrailties (3.1.0) lib/rails/commands/server.rb:70:in `start'\r\nrailties (3.1.0) lib/rails/commands.rb:54:in `block in <top (required)>'\r\nrailties (3.1.0) lib/rails/commands.rb:49:in `tap'\r\nrailties (3.1.0) lib/rails/commands.rb:49:in `<top (required)>'\r\nscript/rails:6:in `require'\r\nscript/rails:6:in `<top (required)>'\r\n-e:1:in `load'\r\n-e:1:in `<main>'\r\n```","comments":1,"title":"Issue when wrapping localized block in scope (Rails 3.1, Ruby 1.9.2)","updated_at":"2011-10-16T12:38:39Z","url":"https://api.github.com/repos/kwi/i18n_routing/issues/30","id":1921343,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"cf3ed91eed72fa093f7e99779135890b","avatar_url":"https://secure.gravatar.com/avatar/cf3ed91eed72fa093f7e99779135890b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ncri","id":16925,"login":"ncri"},"html_url":"https://github.com/kwi/i18n_routing/issues/30","labels":[],"state":"open"},"legacy":{"issue_id":1921343,"comment_id":2420647}}