Created
April 7, 2012 21:23
-
-
Save ruevaughn/2332198 to your computer and use it in GitHub Desktop.
Rake Routes trying to match internationalization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jensenlocksmithing::Application.routes.draw do | |
scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do | |
get "log_out" => "sessions#destroy", as: "log_out" | |
get "log_in" => "sessions#new", as: "log_in" | |
resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do | |
collection do | |
get :home | |
get :about_us | |
get :faq | |
get :discounts | |
get :services | |
get :contact_us | |
get :admin | |
get :posts | |
end | |
end | |
resources :users | |
resources :abouts | |
resources :sessions | |
resources :coupons | |
resources :monthly_posts | |
resources :reviews | |
resources :categories do | |
collection { post :sort } | |
resources :children, :controller => :categories, :only => [:index, :new, :create, :new_subcategory] | |
end | |
resources :products do | |
member do | |
put :move_up | |
put :move_down | |
end | |
end | |
resources :faqs do | |
collection { post :sort } | |
end | |
root :to => 'locale#root' # handles /en/ | |
match "/savesort" => 'sites#savesort' | |
match "*path", to: "locale#not_found" # handles /en/fake/path/whatever | |
end | |
root to: redirect("/#{I18n.default_locale}") # handles / | |
#match '', to: redirect("/#{I18n.default_locale}") | |
match '*path', to: redirect("/#{I18n.default_locale}/%{path}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment