Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/self-control/route_helpers.rb

Instance Method Summary collapse

Instance Method Details

#control_resources(*resources, &block) ⇒ Object



9
10
11
12
13
14
# File 'lib/self-control/route_helpers.rb', line 9

def control_resources(*resources, &block)
  resources(*resources) do
    selfcontrol
    yield if block_given? 
  end
end

#selfcontrolObject



3
4
5
6
7
# File 'lib/self-control/route_helpers.rb', line 3

def selfcontrol
  get 'steps', :action => 'steps_list', :as => 'self_control_steps_list'
  get 'steps/:id', :action => 'start_step', :as => 'self_control_steps'
  post 'steps/:id(/:choose)', :action => 'do_step', :as => 'self_control_steps'
end