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

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Tim Shaffer at Mar 30, 2012 at 12:17 pm
    Can you paste the exact error that you are getting?

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/KQzCf8AuYtoJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Christopher Jones at Apr 2, 2012 at 1:30 pm
    Hi, I am receiving the following error:

    ArgumentError

    missing :controller
    Rails.root: C:/Users/Christopher/Favorites/safety/safety 11/games

    Application Trace | Framework Trace | Full Trace

    config/routes.rb:4:in `block (2 levels) in <top (required)>'
    config/routes.rb:3:in `block in <top (required)>'
    config/routes.rb:1:in `<top (required)>'

    This error occurred while loading the following files:
    C:/Users/Christopher/Favorites/safety/safety
    11/games/config/routes.rb

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Christopher Jones at Apr 2, 2012 at 1:54 pm
    No worries, solved.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 29, '12 at 9:12p
activeApr 2, '12 at 1:54p
posts4
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Christopher Jones: 3 posts Tim Shaffer: 1 post

People

Translate

site design / logo © 2022 Grokbase