From 984503480f074fcdb9218cd9458efec983845878 Mon Sep 17 00:00:00 2001 From: Taylor Griffin Date: Thu, 25 Sep 2014 07:00:11 +1000 Subject: [PATCH] remove necessity to add locale to url if current locale is English --- app/controllers/application_controller.rb | 6 +++++- spec/features/crop_wranglers_spec.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 91fc81413..8fbc8ba95 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,7 +40,11 @@ class ApplicationController < ActionController::Base # Adds locale query parameter to every path / url helper def default_url_options(options={}) - { locale: I18n.locale } + if I18n.locale == :en + {} + else + { locale: I18n.locale } + end end end diff --git a/spec/features/crop_wranglers_spec.rb b/spec/features/crop_wranglers_spec.rb index 327be7e51..80475bd18 100644 --- a/spec/features/crop_wranglers_spec.rb +++ b/spec/features/crop_wranglers_spec.rb @@ -19,7 +19,7 @@ feature "crop wranglers" do within '.crop_wranglers' do expect(page).to have_content 'Crop Wranglers:' crop_wranglers.each do |crop_wrangler| - page.should have_link crop_wrangler.login_name, :href => member_path(crop_wrangler, {locale: 'en'}) + page.should have_link crop_wrangler.login_name, :href => member_path(crop_wrangler) end end end