Hi all, I am having a problem at the moment with my code in which if I
incase my routes with scope ‘(:locale)’ do buy I get the error
controller missing, any ideas why?
Games::Application.routes.draw do
scope ‘(:locale)’ do
get “game_interest/new”
get “rules/index”
get “feedback/index”
get “help/index”
get “log_in” => “sessions#new”, :as => “log_in”
get “log_out” => “sessions#destroy”, :as => “log_out”
get “sign_up” => “users#new”, :as => “sign_up”
get “home/index”
get “about/index”
resources :feedbacks
resources :password_resets
resources :contact_messages
resources :wishlists
resources :searches
resources :help
resources :users
resources :sessions
resources :games do
post ‘email’, :on => :member
post ‘gensearch’, :on => :member
post ‘consearch’, :on => :member
end
root :to => ‘home#index’
end
end
I have the following in my application_controller
before_filter :set_i18n_locale_from_params
def set_i18n_locale_from_params
if params[:locale]
if I18n.available_locales.include?(params[:locale].to_sym)
I18n.locale = params[:locale]
else
flash.now[:notice] =
“#{params[:locale]} translation not available”
logger.error flash.now[:notice]
end
end
end
def default_url_options
{ :locale => I18n.locale }
end