Skip to content

Commit 39ec66f

Browse files
Merge branch 'main' of github.com:navapbc/flex-sdk
2 parents 80d7fb2 + 71ceb6f commit 39ec66f

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/controllers/flex/tasks_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class TasksController < ::ApplicationController
55
helper DateHelper
66

77
before_action :set_task, only: %i[ show update ]
8+
before_action :add_task_details_view_path, only: %i[ show ]
89

910
def task_class
1011
controller_path.classify.constantize
@@ -33,6 +34,10 @@ def set_task
3334
@task = task_class.find(params[:id]) if params[:id].present?
3435
end
3536

37+
def add_task_details_view_path
38+
prepend_view_path "app/views/#{controller_path}"
39+
end
40+
3641
def index_filter_params
3742
params.permit(:filter_date, :filter_type, :filter_status)
3843
end

app/views/flex/tasks/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<%= local_en_us task.due_on %>
6363
</td>
6464
<td data-sort-value="<%= task.type %>">
65-
<%= link_to t("tasks.types.#{task.type.underscore}"), task_path(task) %>
65+
<%= link_to t("tasks.types.#{task.type.underscore}"), url_for(only_path: true, action: :show, id: task.id.to_s) %>
6666
</td>
6767
<td data-sort-value="<%= task.case_id %>"><%= task.case_id %></td>
6868
<td data-sort-value="<%= time_since_epoch task.created_at %>">

app/views/flex/tasks/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<% if content_for?(:task_details_partial) %>
5858
<%= yield(:task_details_partial) %>
5959
<% else %>
60-
<%= render partial: "tasks/details/#{task.type.underscore}", locals: local_assigns.to_h %>
60+
<%= render partial: "details/#{task.type.underscore}", locals: local_assigns.to_h %>
6161
<% end %>
6262
</section>
6363
</main>

0 commit comments

Comments
 (0)