I am adding I18N to my rails application by passing the locale using url params. My urls are looking like http://example.com/en/users and http://example.com/ar/users (for th
This is what worked for me, which preserves params and protects against xss:
= link_to_unless_current "English", url_for( request.params.merge(locale: 'en'))
You could use link_to instead of link_to_unless_current
link_to
link_to_unless_current