Class: Noodall::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/noodall/routes.rb

Class Method Summary collapse

Class Method Details

.draw(app) ⇒ Object



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
# File 'lib/noodall/routes.rb', line 4

def draw(app)
  app.routes.draw do
    root :to => "noodall/nodes#show", :permalink => ['home']
    namespace 'noodall/admin', :as => 'noodall_admin', :path => 'admin' do
      resources :nodes do
        resources :nodes
        resources :versions
        member do
          get :change_template
          get :move_up
          get :move_down
          get :tree
          post :preview
        end
        collection do
          get :tree
          post :filter
        end
      end

      resources :assets do
        collection do
          get :images
          get :videos
          get :documents
          post :plupload
          get :pending
          get :tags
        end
        member do
          get :add
        end
      end
      match 'assets/:asset_type/tags' => 'assets#tags', :as => :asset_tags

      match 'components/form/:type' => 'components#form'

      resources :groups
      resources :keywords
    end

    get "v/:node_id/:id" => "noodall/nodes#version", :as => :noodall_version
    get "search" => "noodall/nodes#search", :as => :noodall_search
    get "sitemap" => "noodall/nodes#sitemap", :as => :noodall_sitemap
    get "*permalink.:format" =>  'noodall/nodes#show'
    get "*permalink(.:format)" =>  'noodall/nodes#show', :as => :node_permalink
  end
end