Browse Source

Remove locale parameter from locale nav

development
Godwin 8 years ago
parent
commit
529e3ab764
  1. 5
      app/helpers/i18n_helper.rb

5
app/helpers/i18n_helper.rb

@ -13,10 +13,13 @@ module I18nHelper
new_params = params.merge({action: (params[:_original_action] || params[:action])}) new_params = params.merge({action: (params[:_original_action] || params[:action])})
new_params.delete(:_original_action) new_params.delete(:_original_action)
if relative || Rails.env.development? || Rails.env.test? if Rails.env.development? || Rails.env.test?
return url_for(new_params.merge({lang: locale.to_s})) return url_for(new_params.merge({lang: locale.to_s}))
end end
# return now if this is a relative path, don't add the host
return url_for(new_params) if relative
subdomain = Rails.env.preview? ? "preview-#{locale.to_s}" : locale.to_s subdomain = Rails.env.preview? ? "preview-#{locale.to_s}" : locale.to_s
url_for(new_params.merge(host: "#{subdomain}.bikebike.org")) url_for(new_params.merge(host: "#{subdomain}.bikebike.org"))
end end

Loading…
Cancel
Save