Class: Noodall::FormBuilder::Routes

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

Class Method Summary collapse

Class Method Details

.draw(app) ⇒ Object



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

def draw(app)
  app.routes.draw do
  
    namespace 'noodall', :as => 'noodall', :path => '' do
      resources :forms do
        resources :form_responses
      end
    end
  
    namespace 'noodall/admin', :as => 'noodall_admin', :path => 'admin' do
      resources :forms do
        resources :form_responses do
          member do
            put :mark_as_spam
            put :mark_as_not_spam
          end
        end
      end
      
      resources :fields do
        collection do
          get :form
        end
      end
      match 'components/form/:type' => 'components#form'
    end
  end
end