Rails 3.2.8 application with bottom gems
gem 'friendly_id', '~> 4.0'
gem 'globalize3',"0.3.0"
gem 'route_translator'
In the controller / app / controllers / home _controller.rb
def static_pages
@static_page = StaticPage.find_by_page_url(params[:page])
end
In the routes.rb file
match "/page/:page" => "home#static_pages", :as => :static_page
localized do
match "label_vacancies/:job_offer"=>"job_seekers#job_offer"
end
In the view file
<div class="bot-cont1">
<ul>
<% @static_pages.each do |sp| %>
<% if sp.page_url %>
<li><%=link_to sp.page_name , static_page_path(:page=>sp.page_url) %></li>
<%end%>
<%end%>
So below is the current URL format for static pages
https:
https:
https:
But the below language format is required below.
Aboutus:
https://www.xxxxxx.com/en/about-us
https://www.xxxxxx.com/de/uber-uns
https://www.xxxxxx.com/es/sobre-nosotros
Contact:
https://www.xxxxxx.com/us/contact-us
https://www.xxxxxx.com/de/kontaktiere-uns
https://www.xxxxxx.com/es/contacto
How to achieve this URL format format for static pages by language. Thanks in advance.
source
share