Module: SelfControl::ControllerExtensions::InstanceMethods

Defined in:
lib/self-control/controller_extensions.rb

Instance Method Summary collapse

Instance Method Details

#do_stepObject



22
23
24
25
26
# File 'lib/self-control/controller_extensions.rb', line 22

def do_step
  authorize_selfcontrol_step!
  selfcontrol.do!(params[:id],params[:choose],params[:self_control_step])
  respond_with(selfcontrol_resource, :location => selfcontrol_resource_location)
end

#start_stepObject



12
13
14
15
16
17
18
19
20
# File 'lib/self-control/controller_extensions.rb', line 12

def start_step        
  authorize_selfcontrol_step!
  
  if action_methods.include?(params[:id])
    send(params[:id])
  else
    render params[:id]
  end
end

#steps_listObject



7
8
9
10
# File 'lib/self-control/controller_extensions.rb', line 7

def steps_list
  @selfcontrol_steps = valid_selfcontrol? ? selfcontrol.steps_for(selfcontrol_actor) : []
  respond_with(@selfcontrol_steps)
end