title: Starting rails I18n and url helpers seem to confuse locale with id
body: <p>I have just started trying to update our rails 3.2 app for internationalization.  I have an optional scope in the routes, like</p>
  
  <blockquote>
    <p>scope "(:locale)", locale: /en|es|zh-HK|de|fr/ do</p>
  </blockquote>
  
  <p>as described by <a href="http://guides.rubyonrails.org/i18n.html" rel="nofollow">http://guides.rubyonrails.org/i18n.html</a>.</p>
  
  <p>And my url helper like</p>
  
  <blockquote>
    <p>watch_url(@watch)</p>
  </blockquote>
  
  <p>gets errors in the form</p>
  
  <blockquote>
    <p>No route matches {:action=>"show", :controller=>"watches", :locale=>#&lt;Watch id: 1, rule_name: "MyRule", start_time: "2014-06-08 03:30:03", end_time: nil, last_execution_time: nil, frequency_mins: 60, rest_period: 0, enabled: true, last_rule_result: false, owner: "me", one_shot: false, args: {"x"=>"", "recipients"=>"", "attributes"=>""}, state: {}, hidden: false, comment: "">}</p>
  </blockquote>
  
  <p>Any ideas on why it is happening and how I can fix it?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>In my application controller, I have</p>
  
  <pre><code>  before_filter :set_locale
  
    def set_locale
      I18n.locale = params[:locale] || I18n.default_locale
    end
  </code></pre>
  
  <p>And the routes that are for the watches controller (This is an 8 year old proprietary app and we have 100+ controllers :(, so I won't include all the routes)...</p>
  
  <pre><code>$ rake routes | grep watch
                                watches GET    (/:locale)/watches(.:format)                                                         watches#index  {:locale=&gt;/en|es|zh-HK|de|fr/}
                                        POST   (/:locale)/watches(.:format)                                                         watches#create {:locale=&gt;/en|es|zh-HK|de|fr/}
                              new_watch GET    (/:locale)/watches/new(.:format)                                                     watches#new {:locale=&gt;/en|es|zh-HK|de|fr/}
                             edit_watch GET    (/:locale)/watches/:id/edit(.:format)                                                watches#edit {:locale=&gt;/en|es|zh-HK|de|fr/}
                                  watch GET    (/:locale)/watches/:id(.:format)                                                     watches#show {:locale=&gt;/en|es|zh-HK|de|fr/}
                                        PUT    (/:locale)/watches/:id(.:format)                                                     watches#update {:locale=&gt;/en|es|zh-HK|de|fr/}
                                        DELETE (/:locale)/watches/:id(.:format)                                                     watches#destroy {:locale=&gt;/en|es|zh-HK|de|fr/}
  </code></pre>
  
  <p>I don't think the show method is relevant.  The error happens in the url helper, and the flow never gets to the show code.</p>