Skip to content

Commit 893b64f

Browse files
committed
Rename CohortsController
To Programmes::CohortsController, to better structure the controllers in relation to how they're shown on the frontend.
1 parent 85f8206 commit 893b64f

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/components/app_programme_navigation_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def call
1818

1919
nav.with_item(
2020
href: programme_cohorts_path(programme),
21-
text: I18n.t("cohorts.index.title"),
21+
text: I18n.t("programmes.cohorts.index.title"),
2222
selected: active == :cohorts
2323
)
2424

app/controllers/cohorts_controller.rb renamed to app/controllers/programmes/cohorts_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class CohortsController < ApplicationController
3+
class Programmes::CohortsController < ApplicationController
44
include Pagy::Backend
55

66
before_action :set_programme

app/views/cohorts/index.html.erb renamed to app/views/programmes/cohorts/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= content_for :page_title, "#{@programme.name} – #{t("cohorts.index.title")}" %>
1+
<%= content_for :page_title, "#{@programme.name} – #{t(".title")}" %>
22

33
<% content_for :before_main do %>
44
<%= render AppBreadcrumbComponent.new(items: [

app/views/cohorts/show.html.erb renamed to app/views/programmes/cohorts/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ text: t("dashboard.index.title"), href: dashboard_path },
44
{ text: t("programmes.index.title"), href: programmes_path },
55
{ text: @programme.name, href: programme_path(@programme) },
6-
{ text: t("cohorts.index.title"), href: programme_cohorts_path(@programme) },
6+
{ text: t("programmes.cohorts.index.title"), href: programme_cohorts_path(@programme) },
77
]) %>
88
<% end %>
99

config/locales/en.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,6 @@ en:
490490
zero: No children
491491
one: 1 child
492492
other: "%{count} children"
493-
cohorts:
494-
index:
495-
title: Cohorts
496493
consent_forms:
497494
index:
498495
title: Unmatched consent responses
@@ -584,6 +581,9 @@ en:
584581
index:
585582
title: Children
586583
programmes:
584+
cohorts:
585+
index:
586+
title: Cohorts
587587
index:
588588
title: Programmes
589589
sessions:

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
get "consent-form", action: "consent_form"
180180
end
181181

182-
resources :cohorts, only: %i[index show]
182+
resources :cohorts, only: %i[index show], controller: "programmes/cohorts"
183183

184184
resources :vaccination_records,
185185
path: "vaccination-records",

0 commit comments

Comments
 (0)