Skip to content

Instantly share code, notes, and snippets.

@takuyan
Created July 23, 2012 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuyan/3162077 to your computer and use it in GitHub Desktop.
Save takuyan/3162077 to your computer and use it in GitHub Desktop.
http://proofoflife.me のroutes.rb
Life::Application.routes.draw do
scope ":locale", locale: /en|ja/ do
root to: "main#index"
resources :provider_users, only: [:destroy]
resources :contacts
resources :messages
resources :recipients, only: [:create, :destroy] do
collection do
get :search
end
end
devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
resource :user, only: [:show] do
member do
post :update_last_confirm_date
get :proof
end
end
match "/about" => "main#about"
match "/faqs" => "main#faqs"
match "/privacy" => "main#privacy"
match "/terms" => "main#terms"
match "/home" => "home#index", as: "home"
match "/home/tutorial" => "home#tutorial", as: "tutorial_home"
match "/home/watch" => "home#watch", as: "watch_home"
match "/home/todos" => "home#todos", as: "todos_home"
match "/home/mail" => "home#mail", as: "mail_home"
match "/home/send_mail" => "home#send_mail", as: "send_mail_home"
match "/user/proof/:proof_token" => "users#proof", proof_token: nil, as: :proof
end
mount Resque::Server, at: "/resque"
match '*path', to: redirect("/#{I18n.default_locale}/%{path}"), constraints: lambda { |req| !req.path.starts_with? "/#{I18n.default_locale}/" }
match '', to: redirect("/#{I18n.default_locale}")
end
@takuyan
Copy link
Author

takuyan commented Jul 23, 2012

http://proofoflife.me がこんな感じのroutes.rbで構成されています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment