Class: TasksController
Instance Method Summary
collapse
included
#current_ability
#voluntary_application_javascripts, #voluntary_application_stylesheets
included
Instance Method Details
#create ⇒ Object
35
36
37
38
39
40
41
|
# File 'app/controllers/tasks_controller.rb', line 35
def create
if @task.save
redirect_to story_tasks_path(@story), notice: t('tasks.create.successful')
else
render 'new'
end
end
|
#destroy ⇒ Object
54
55
56
57
|
# File 'app/controllers/tasks_controller.rb', line 54
def destroy
@task.destroy
redirect_to story_tasks_path(@story), notice: t('general.form.destroyed')
end
|
#edit ⇒ Object
43
44
|
# File 'app/controllers/tasks_controller.rb', line 43
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
32
33
|
# File 'app/controllers/tasks_controller.rb', line 32
def new
end
|
#parent ⇒ Object
68
69
70
|
# File 'app/controllers/tasks_controller.rb', line 68
def parent
@story
end
|
#resource ⇒ Object
59
60
61
62
63
64
|
# File 'app/controllers/tasks_controller.rb', line 59
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
66
|
# File 'app/controllers/tasks_controller.rb', line 66
def resource=(value); @task = value; end
|
#show ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/tasks_controller.rb', line 19
def show
@comments = @task.
@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
46
47
48
49
50
51
52
|
# File 'app/controllers/tasks_controller.rb', line 46
def update
if @task.update(params[:task])
redirect_to(
edit_task_path(@task), notice: t('tasks.update.successful')
)
end
end
|