/ Published in: Rails
Expand |
Embed | Plain Text
# config/routes.rb: scope "(/:locale)" do resources :items end # app/application_controller.rb class ApplicationController < ActionController::Base protect_from_forgery before_filter :set_locale def set_locale I18n.locale = params[:locale] end def default_url_options(options={}) {:locale => I18n.locale} end end # config/application.rb or config/environments/production.rb: Tassuttelijat::Application.configure do config.i18n.default_locale = :fi end # Make sure the previous lines are before this one: Tassuttelijat::Application.initialize!
You need to login to post a comment.
