File: routes.rb

package info (click to toggle)
ruby-js-routes 1.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 316 kB
  • sloc: ruby: 1,430; javascript: 504; makefile: 4
file content (75 lines) | stat: -rw-r--r-- 2,260 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def draw_routes

  BlogEngine::Engine.routes.draw do
    root to: "application#index"
    resources :posts
  end
  App.routes.draw do

    get 'support(/page/:page)', to: BlogEngine::Engine, as: 'support'

    resources :inboxes, only: [:index, :show] do
      resources :messages, only: [:index, :show] do
        resources :attachments, only: [:new, :show]
      end
    end

    root :to => "inboxes#index"

    namespace :admin do
      resources :users, only: [:index]
    end

    scope "/returns/:return" do
      resources :objects, only: [:show]
    end

    scope "(/optional/:optional_id)" do
      resources :things, only: [:show, :index]
    end

    get "(/sep1/:first_optional)/sep2/:second_required/sep3/:third_required(/:forth_optional)",
      as: :thing_deep, controller: :things, action: :show

    if Rails.version < "5.0.0"
      get "/:controller(/:action(/:id))" => "classic#classic", :as => :classic
    end

    get "/other_optional/(:optional_id)" => "foo#foo", :as => :foo
    get '/other_optional(/*optional_id)' => 'foo#foo', :as => :foo_all

    get 'books/*section/:title' => 'books#show', :as => :book
    get 'books/:title/*section' => 'books#show', :as => :book_title

    mount BlogEngine::Engine => "/blog", :as => :blog_app

    get '/no_format' => "foo#foo", :format => false, :as => :no_format

    get '/json_only' => "foo#foo", :format => true, :constraints => {:format => /json/}, :as => :json_only

    get '/привет' => "foo#foo", :as => :hello
    get '(/o/:organization)/search/:q' => "foo#foo", as: :search

    resources :sessions, :only => [:new, :create], :protocol => 'https'
    get '/' => 'sso#login', host: 'sso.example.com', as: :sso
    get "/" => "a#b", subdomain: 'www', host: 'example.com', port: 88, as: :secret_root

    resources :portals, :port => 8080, only: [:index]

    get '/with_defaults' => 'foo#foo', defaults: { bar: 'tested', format: :json }, format: :true

    namespace :api, format: true, defaults: {format: 'json'} do
      get "/purchases" => "purchases#index"
    end

    resources :budgies, only: [:show, :index] do
      get "descendents"
    end

    namespace :backend, path: '', constraints: {subdomain: 'backend'} do
      root to: 'backend#index'
    end

  end

end