Class: TasksController
Instance Method Summary
collapse
included
#current_ability
#voluntary_application_javascripts, #voluntary_application_stylesheets
included
Instance Method Details
#create ⇒ Object
34
35
36
37
38
39
40
|
# File 'app/controllers/tasks_controller.rb', line 34
def create
if @task.save
redirect_to story_tasks_path(@story), notice: t('tasks.create.successful')
else
render 'new'
end
end
|
#destroy ⇒ Object
53
54
55
56
|
# File 'app/controllers/tasks_controller.rb', line 53
def destroy
@task.destroy
redirect_to story_tasks_path(@story), notice: t('general.form.destroyed')
end
|
#edit ⇒ Object
42
43
|
# File 'app/controllers/tasks_controller.rb', line 42
def edit
end
|
#index ⇒ Object
11
12
13
14
15
16
17
|
# File 'app/controllers/tasks_controller.rb', line 11
def index
@story = Story.find(params[:story_id])
@project = @story.project
@tasks = @story.custom_tasks
@tasks = @tasks.paginate(page: params[:page], per_page: 25)
@twitter_sidenav_level = 5
end
|
#new ⇒ Object
31
32
|
# File 'app/controllers/tasks_controller.rb', line 31
def new
end
|
#parent ⇒ Object
67
68
69
|
# File 'app/controllers/tasks_controller.rb', line 67
def parent
@story
end
|
#resource ⇒ Object
58
59
60
61
62
63
|
# File 'app/controllers/tasks_controller.rb', line 58
def resource
@task = Task.find(params[:id]) unless @task || !params[:id].present?
@story = @task.story unless @story || !@task
@project = @story.project
@task
end
|
#resource=(value) ⇒ Object
65
|
# File 'app/controllers/tasks_controller.rb', line 65
def resource=(value); @task = value; end
|
#show ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/tasks_controller.rb', line 19
def show
@hide_sidebar = true
begin
raise NotImplementedError if @project.product_id.blank?
render "products/types/#{@project.product.class.name.split('Product::').last.tableize.singularize}/tasks/show"
rescue NotImplementedError, ActionView::MissingTemplate
render 'show'
end
end
|
#update ⇒ Object
45
46
47
48
49
50
51
|
# File 'app/controllers/tasks_controller.rb', line 45
def update
if @task.update(params[:task])
redirect_to(
edit_task_path(@task), notice: t('tasks.update.successful')
)
end
end
|