Merge branch 'development' of https://github.com/kaungkaungc2l/magic into development
This commit is contained in:
@@ -30,15 +30,16 @@ class TasksController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def complete
|
|
||||||
@task = @project.tasks.find(params[:id])
|
|
||||||
@task.update(status: "done")
|
|
||||||
|
|
||||||
respond_to do |format|
|
def complete
|
||||||
format.turbo_stream
|
@task = @project.tasks.find(params[:id])
|
||||||
format.html { redirect_to @project }
|
@task.update(status: "done")
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.turbo_stream
|
||||||
|
format.html { redirect_to @project }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
<li>
|
<li>
|
||||||
<%= task.title %> (<%= task.status %>)
|
<%= task.title %> (<%= task.status %>)
|
||||||
|
|
||||||
<%= link_to "Destroy", project_task_path(task.project, task), data: {
|
<%= link_to "Destroy", project_task_path(task.project, task),
|
||||||
turbo_method: :delete,
|
data: { turbo_method: :delete, turbo_confirm: "Are you sure?" } %>
|
||||||
turbo_confirm: "Are you sure?"
|
|
||||||
} %>
|
|
||||||
|
|
||||||
<% unless task.status == "completed" %>
|
<% unless task.status == "done" %>
|
||||||
<%= button_to "Complete", complete_project_task_path(task.project, task),
|
<%= button_to "Complete",
|
||||||
method: :patch,
|
complete_project_task_path(task.project, task),
|
||||||
form: { data: { turbo_frame: dom_id(task) } } %>
|
method: :patch,
|
||||||
|
form: { data: { turbo_frame: dom_id(task) } } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
</turbo-frame>
|
</turbo-frame>
|
||||||
Reference in New Issue
Block a user