Class: TasksController
Instance Method Summary
collapse
#next_wizard_path, #previous_wizard_path, #wizard_path
#current_step?, #future_step?, #jump_to, #last_step?, #next_step, #next_step?, #past_step?, #previous_step, #previous_step?, #skip_step, #step, #wizard_resource_class_name, #wizard_step_per_state, #wizard_steps
included
#current_ability
#voluntary_application_javascripts, #voluntary_application_repository_path, #voluntary_application_stylesheets
included
Instance Method Details
#create ⇒ Object
27
28
29
30
31
32
33
|
# File 'app/controllers/tasks_controller.rb', line 27
def create
if @task.initialization
redirect_to edit_task_path(@task) and return
else
render_wizard
end
end
|
#destroy ⇒ Object
57
58
59
60
61
|
# File 'app/controllers/tasks_controller.rb', line 57
def destroy
@task = Task.find(params[:id])
@task.destroy
redirect_to @task.story, notice: t('general.form.destroyed')
end
|
#edit ⇒ Object
35
36
37
|
# File 'app/controllers/tasks_controller.rb', line 35
def edit
render_wizard
end
|
#index ⇒ Object
14
15
16
17
|
# File 'app/controllers/tasks_controller.rb', line 14
def index
parent = find_parent Task::PARENT_TYPES
@tasks = parent ? parent.tasks : Task.all
end
|
#new ⇒ Object
23
24
25
|
# File 'app/controllers/tasks_controller.rb', line 23
def new
render_wizard
end
|
#parent ⇒ Object
71
72
73
|
# File 'app/controllers/tasks_controller.rb', line 71
def parent
@story
end
|
#resource ⇒ Object
63
64
65
66
67
|
# File 'app/controllers/tasks_controller.rb', line 63
def resource
@task = Task.find(params[:id]) unless @task || !params[:id].present?
@story = @task.story unless @story || !@task
@task
end
|
#resource=(value) ⇒ Object
69
|
# File 'app/controllers/tasks_controller.rb', line 69
def resource=(value); @task = value; end
|
#show ⇒ Object
19
20
21
|
# File 'app/controllers/tasks_controller.rb', line 19
def show
@comments = @task.
end
|
#update ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'app/controllers/tasks_controller.rb', line 39
def update
@task.attributes = params[:task]
@task.tasks.shift if params[:next_step] == '1' && !@task.tasks.first.valid?
success = params[:next_step] == '1' ? @task.send(step) : @task.save
if success
redirect_to(
edit_task_path(@task), notice: t('general.form.successfully_updated')
)
else
render_wizard
end
return
end
|