remove necessity to add locale to url if current locale is English

This commit is contained in:
Taylor Griffin
2014-09-25 07:00:11 +10:00
parent 5e48c4392a
commit 984503480f
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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