Reputation: 309
I am working on a web app. which will have two languages on it.
I will have a default root page, root :to => "home#index" which will be on English (e.g www.test.com/en/home). Now, after clicking on other language on the page, for example russian, i would like to switch page from www.test.com/en/home to www.test.com/ru/home which will load different page on language i selected and it will automatically become a home page.
First idea was to create a controller for this, but since my rails knowlege is on lower level, i assume thats not something i would like to do.
Any suggestions?
-Michael
Upvotes: 0
Views: 65
Reputation: 220
I excepted that you want multi language app, so your routes.rb may look like this bellow:
# config/routes.rb
scope ':locale' do
root :to => "home#index"
end
Better informations you can find on 2.5 Setting the Locale from the URL
Upvotes: 1