From cbc79b2a279b98a3c03b57627631c25295e46e28 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Thu, 19 Jun 2025 14:35:46 +0000 Subject: [PATCH 01/11] Intial work on adding programme activity grouping to administrate --- .../admin/programme_activities_controller.rb | 46 ++++++++++ ...programme_activity_groupings_controller.rb | 47 ++++++++++ app/dashboards/pathway_activity_dashboard.rb | 6 +- .../programme_activity_dashboard.rb | 74 ++++++++++++++++ .../programme_activity_grouping_dashboard.rb | 88 +++++++++++++++++++ ...mme_activity_grouping_json_viewer_field.rb | 3 + .../_form.html.erb | 14 +++ .../_index.html.erb | 1 + .../_show.html.erb | 6 ++ config/routes.rb | 2 + 10 files changed, 284 insertions(+), 3 deletions(-) create mode 100644 app/controllers/admin/programme_activities_controller.rb create mode 100644 app/controllers/admin/programme_activity_groupings_controller.rb create mode 100644 app/dashboards/programme_activity_dashboard.rb create mode 100644 app/dashboards/programme_activity_grouping_dashboard.rb create mode 100644 app/fields/programme_activity_grouping_json_viewer_field.rb create mode 100644 app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb create mode 100644 app/views/fields/programme_activity_grouping_json_viewer_field/_index.html.erb create mode 100644 app/views/fields/programme_activity_grouping_json_viewer_field/_show.html.erb diff --git a/app/controllers/admin/programme_activities_controller.rb b/app/controllers/admin/programme_activities_controller.rb new file mode 100644 index 0000000000..e0a462de74 --- /dev/null +++ b/app/controllers/admin/programme_activities_controller.rb @@ -0,0 +1,46 @@ +module Admin + class ProgrammeActivitiesController < Admin::ApplicationController + # Overwrite any of the RESTful controller actions to implement custom behavior + # For example, you may want to send an email after a foo is updated. + # + # def update + # super + # send_foo_updated_email(requested_resource) + # end + + # Override this method to specify custom lookup behavior. + # This will be used to set the resource for the `show`, `edit`, and `update` + # actions. + # + # def find_resource(param) + # Foo.find_by!(slug: param) + # end + + # The result of this lookup will be available as `requested_resource` + + # Override this if you have certain roles that require a subset + # this will be used to set the records shown on the `index` action. + # + # def scoped_resource + # if current_user.super_admin? + # resource_class + # else + # resource_class.with_less_stuff + # end + # end + + # Override `resource_params` if you want to transform the submitted + # data before it's persisted. For example, the following would turn all + # empty values into nil values. It uses other APIs such as `resource_class` + # and `dashboard`: + # + # def resource_params + # params.require(resource_class.model_name.param_key). + # permit(dashboard.permitted_attributes(action_name)). + # transform_values { |value| value == "" ? nil : value } + # end + + # See https://administrate-demo.herokuapp.com/customizing_controller_actions + # for more information + end +end diff --git a/app/controllers/admin/programme_activity_groupings_controller.rb b/app/controllers/admin/programme_activity_groupings_controller.rb new file mode 100644 index 0000000000..c5f7f72065 --- /dev/null +++ b/app/controllers/admin/programme_activity_groupings_controller.rb @@ -0,0 +1,47 @@ +module Admin + class ProgrammeActivityGroupingsController < Admin::ApplicationController + # Overwrite any of the RESTful controller actions to implement custom behavior + # For example, you may want to send an email after a foo is updated. + # + # def update + # super + # send_foo_updated_email(requested_resource) + # end + + # Override this method to specify custom lookup behavior. + # This will be used to set the resource for the `show`, `edit`, and `update` + # actions. + # + def find_resource(param) + ProgrammeActivityGrouping.find_by!(id: param) + end + + # The result of this lookup will be available as `requested_resource` + + # Override this if you have certain roles that require a subset + # this will be used to set the records shown on the `index` action. + # + # def scoped_resource + # if current_user.super_admin? + # resource_class + # else + # resource_class.with_less_stuff + # end + # end + + # Override `resource_params` if you want to transform the submitted + # data before it's persisted. For example, the following would turn all + # empty values into nil values. It uses other APIs such as `resource_class` + # and `dashboard`: + # + def resource_params + params.require(resource_class.model_name.param_key).permit( + dashboard.permitted_attributes(action_name), + web_copy: {} + ) + end + + # See https://administrate-demo.herokuapp.com/customizing_controller_actions + # for more information + end +end diff --git a/app/dashboards/pathway_activity_dashboard.rb b/app/dashboards/pathway_activity_dashboard.rb index bd4347fa19..b6cb12704f 100644 --- a/app/dashboards/pathway_activity_dashboard.rb +++ b/app/dashboards/pathway_activity_dashboard.rb @@ -59,7 +59,7 @@ class PathwayActivityDashboard < BaseDashboard # Overwrite this method to customize how pathway activities are displayed # across all pages of the admin dashboard. # - # def display_resource(pathway_activity) - # "PathwayActivity ##{pathway_activity.id}" - # end + def display_resource(pathway_activity) + "#{pathway_activity.activity.stem_activity_code} - #{pathway_activity.activity.title}" + end end diff --git a/app/dashboards/programme_activity_dashboard.rb b/app/dashboards/programme_activity_dashboard.rb new file mode 100644 index 0000000000..7f6a013f76 --- /dev/null +++ b/app/dashboards/programme_activity_dashboard.rb @@ -0,0 +1,74 @@ +require "administrate/base_dashboard" + +class ProgrammeActivityDashboard < Administrate::BaseDashboard + # ATTRIBUTE_TYPES + # a hash that describes the type of each of the model's fields. + # + # Each different type represents an Administrate::Field object, + # which determines how the attribute is displayed + # on pages throughout the dashboard. + ATTRIBUTE_TYPES = { + id: Field::String, + activity: Field::BelongsTo, + legacy: Field::Boolean, + order: Field::Number, + programme: Field::BelongsTo, + programme_activity_grouping: Field::BelongsTo, + created_at: Field::DateTime, + updated_at: Field::DateTime + }.freeze + + # COLLECTION_ATTRIBUTES + # an array of attributes that will be displayed on the model's index page. + # + # By default, it's limited to four items to reduce clutter on index pages. + # Feel free to add, remove, or rearrange items. + COLLECTION_ATTRIBUTES = %i[ + activity + legacy + order + ].freeze + + # SHOW_PAGE_ATTRIBUTES + # an array of attributes that will be displayed on the model's show page. + SHOW_PAGE_ATTRIBUTES = %i[ + id + activity + legacy + order + programme + programme_activity_grouping + created_at + updated_at + ].freeze + + # FORM_ATTRIBUTES + # an array of attributes that will be displayed + # on the model's form (`new` and `edit`) pages. + FORM_ATTRIBUTES = %i[ + activity + legacy + order + programme + programme_activity_grouping + ].freeze + + # COLLECTION_FILTERS + # a hash that defines filters that can be used while searching via the search + # field of the dashboard. + # + # For example to add an option to search for open resources by typing "open:" + # in the search field: + # + # COLLECTION_FILTERS = { + # open: ->(resources) { resources.where(open: true) } + # }.freeze + COLLECTION_FILTERS = {}.freeze + + # Overwrite this method to customize how programme activities are displayed + # across all pages of the admin dashboard. + # + def display_resource(programme_activity) + programme_activity.activity.title + end +end diff --git a/app/dashboards/programme_activity_grouping_dashboard.rb b/app/dashboards/programme_activity_grouping_dashboard.rb new file mode 100644 index 0000000000..dc2ecf657a --- /dev/null +++ b/app/dashboards/programme_activity_grouping_dashboard.rb @@ -0,0 +1,88 @@ +require "administrate/base_dashboard" +require "administrate/field/jsonb" + +class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard + # ATTRIBUTE_TYPES + # a hash that describes the type of each of the model's fields. + # + # Each different type represents an Administrate::Field object, + # which determines how the attribute is displayed + # on pages throughout the dashboard. + ATTRIBUTE_TYPES = { + id: Field::String, + activities: Field::HasMany, + community: Field::Boolean, + metadata: Field::String.with_options(searchable: false), + objectives: Field::String.with_options(searchable: false), + programme: Field::BelongsTo, + programme_activities: Field::HasMany, + progress_bar_title: Field::String, + required_for_completion: Field::Number, + sort_key: Field::Number, + title: Field::String, + web_copy: ProgrammeActivityGroupingJsonViewerField, + created_at: Field::DateTime, + updated_at: Field::DateTime + }.freeze + + # COLLECTION_ATTRIBUTES + # an array of attributes that will be displayed on the model's index page. + # + # By default, it's limited to four items to reduce clutter on index pages. + # Feel free to add, remove, or rearrange items. + COLLECTION_ATTRIBUTES = %i[ + title + programme + activities + community + ].freeze + + # SHOW_PAGE_ATTRIBUTES + # an array of attributes that will be displayed on the model's show page. + SHOW_PAGE_ATTRIBUTES = %i[ + title + progress_bar_title + programme + web_copy + community + metadata + objectives + programme_activities + ].freeze + + # FORM_ATTRIBUTES + # an array of attributes that will be displayed + # on the model's form (`new` and `edit`) pages. + FORM_ATTRIBUTES = %i[ + title + activities + community + metadata + objectives + programme + programme_activities + progress_bar_title + required_for_completion + sort_key + web_copy + ].freeze + + # COLLECTION_FILTERS + # a hash that defines filters that can be used while searching via the search + # field of the dashboard. + # + # For example to add an option to search for open resources by typing "open:" + # in the search field: + # + # COLLECTION_FILTERS = { + # open: ->(resources) { resources.where(open: true) } + # }.freeze + COLLECTION_FILTERS = {}.freeze + + # Overwrite this method to customize how programme activity groupings are displayed + # across all pages of the admin dashboard. + # + def display_resource(programme_activity_grouping) + "#{programme_activity_grouping.title}" + end +end diff --git a/app/fields/programme_activity_grouping_json_viewer_field.rb b/app/fields/programme_activity_grouping_json_viewer_field.rb new file mode 100644 index 0000000000..40664e0ea5 --- /dev/null +++ b/app/fields/programme_activity_grouping_json_viewer_field.rb @@ -0,0 +1,3 @@ +require "administrate/field/base" + +class ProgrammeActivityGroupingJsonViewerField < Administrate::Field::Base; end diff --git a/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb b/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb new file mode 100644 index 0000000000..0c37b8b17c --- /dev/null +++ b/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb @@ -0,0 +1,14 @@ +
+ + <% field.data.each do |k, v| %> + + + + + <% end %> +
+ <%= f.label "web_copy[#{k}]", k.humanize %> + + <%= f.text_field "web_copy[#{k}]", value: v %> +
+
diff --git a/app/views/fields/programme_activity_grouping_json_viewer_field/_index.html.erb b/app/views/fields/programme_activity_grouping_json_viewer_field/_index.html.erb new file mode 100644 index 0000000000..5177ca4641 --- /dev/null +++ b/app/views/fields/programme_activity_grouping_json_viewer_field/_index.html.erb @@ -0,0 +1 @@ +<%= field.data %> diff --git a/app/views/fields/programme_activity_grouping_json_viewer_field/_show.html.erb b/app/views/fields/programme_activity_grouping_json_viewer_field/_show.html.erb new file mode 100644 index 0000000000..43dcffee58 --- /dev/null +++ b/app/views/fields/programme_activity_grouping_json_viewer_field/_show.html.erb @@ -0,0 +1,6 @@ +<% field.data.each do |v| %> + <%= content_tag :dl, class: ['attribute--nested'] do %> +
<%= v.first %>:
+
<%= "#{v.last}" %>
+ <% end %> +<% end %> diff --git a/config/routes.rb b/config/routes.rb index 66e4946158..0a2ece2b97 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ end resources :sent_emails, only: %i[index show] resources :support_audits, only: %i[index show update edit] + resources :programme_activity_groupings + resources :users, only: %i[index create show edit perform_sync perform_reset update] do get "/perform_sync/:user_id", to: "users#perform_sync", as: :perform_sync get "/perform_reset/:user_id", to: "users#perform_reset_tests", as: :perform_reset From e5edb27fd77ef729c59be801e775bc380f5c1b21 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Thu, 19 Jun 2025 14:36:36 +0000 Subject: [PATCH 02/11] Standardrb fix --- app/dashboards/programme_activity_grouping_dashboard.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dashboards/programme_activity_grouping_dashboard.rb b/app/dashboards/programme_activity_grouping_dashboard.rb index dc2ecf657a..ecd979e32d 100644 --- a/app/dashboards/programme_activity_grouping_dashboard.rb +++ b/app/dashboards/programme_activity_grouping_dashboard.rb @@ -83,6 +83,6 @@ class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard # across all pages of the admin dashboard. # def display_resource(programme_activity_grouping) - "#{programme_activity_grouping.title}" + programme_activity_grouping.title.to_s end end From f045072f36e1db104cd789d06939ad53b24d8dbe Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Thu, 19 Jun 2025 14:38:55 +0000 Subject: [PATCH 03/11] Update route to remove delete option --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 0a2ece2b97..f633160b9d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,7 +32,7 @@ end resources :sent_emails, only: %i[index show] resources :support_audits, only: %i[index show update edit] - resources :programme_activity_groupings + resources :programme_activity_groupings, only: %i[index show update edit] resources :users, only: %i[index create show edit perform_sync perform_reset update] do get "/perform_sync/:user_id", to: "users#perform_sync", as: :perform_sync From b845a0aaba7071784210e2cf89201997c625f23e Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Thu, 19 Jun 2025 14:59:36 +0000 Subject: [PATCH 04/11] Rearranging and moving fields on the dashboard --- app/dashboards/programme_activity_grouping_dashboard.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/dashboards/programme_activity_grouping_dashboard.rb b/app/dashboards/programme_activity_grouping_dashboard.rb index ecd979e32d..f3ec7db81b 100644 --- a/app/dashboards/programme_activity_grouping_dashboard.rb +++ b/app/dashboards/programme_activity_grouping_dashboard.rb @@ -12,8 +12,6 @@ class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard id: Field::String, activities: Field::HasMany, community: Field::Boolean, - metadata: Field::String.with_options(searchable: false), - objectives: Field::String.with_options(searchable: false), programme: Field::BelongsTo, programme_activities: Field::HasMany, progress_bar_title: Field::String, @@ -43,10 +41,8 @@ class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard title progress_bar_title programme - web_copy community - metadata - objectives + web_copy programme_activities ].freeze @@ -57,13 +53,10 @@ class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard title activities community - metadata - objectives programme programme_activities progress_bar_title required_for_completion - sort_key web_copy ].freeze From 8d96dd9d25d15b9048e4d4e10c8d42bc63942efc Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Thu, 19 Jun 2025 15:03:07 +0000 Subject: [PATCH 05/11] Remove comments --- ...programme_activity_groupings_controller.rb | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/app/controllers/admin/programme_activity_groupings_controller.rb b/app/controllers/admin/programme_activity_groupings_controller.rb index c5f7f72065..421ed7c679 100644 --- a/app/controllers/admin/programme_activity_groupings_controller.rb +++ b/app/controllers/admin/programme_activity_groupings_controller.rb @@ -1,47 +1,14 @@ module Admin class ProgrammeActivityGroupingsController < Admin::ApplicationController - # Overwrite any of the RESTful controller actions to implement custom behavior - # For example, you may want to send an email after a foo is updated. - # - # def update - # super - # send_foo_updated_email(requested_resource) - # end - - # Override this method to specify custom lookup behavior. - # This will be used to set the resource for the `show`, `edit`, and `update` - # actions. - # def find_resource(param) ProgrammeActivityGrouping.find_by!(id: param) end - # The result of this lookup will be available as `requested_resource` - - # Override this if you have certain roles that require a subset - # this will be used to set the records shown on the `index` action. - # - # def scoped_resource - # if current_user.super_admin? - # resource_class - # else - # resource_class.with_less_stuff - # end - # end - - # Override `resource_params` if you want to transform the submitted - # data before it's persisted. For example, the following would turn all - # empty values into nil values. It uses other APIs such as `resource_class` - # and `dashboard`: - # def resource_params params.require(resource_class.model_name.param_key).permit( dashboard.permitted_attributes(action_name), web_copy: {} ) end - - # See https://administrate-demo.herokuapp.com/customizing_controller_actions - # for more information end end From 22321be165e45772ecee240faf50751513841d4e Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Fri, 20 Jun 2025 07:10:45 +0000 Subject: [PATCH 06/11] Sonarcloud fix --- .../_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb b/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb index 0c37b8b17c..da5ec183a2 100644 --- a/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb +++ b/app/views/fields/programme_activity_grouping_json_viewer_field/_form.html.erb @@ -2,9 +2,9 @@ <% field.data.each do |k, v| %> - From 9123fb77db97c8cc8c428ae506ede0acd7e57f02 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Fri, 20 Jun 2025 08:53:52 +0000 Subject: [PATCH 07/11] Adding request test for programme activity grouping dashboard --- .../programme_activity_groupings_spec.rb | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 spec/requests/admin/programme_activity_groupings_spec.rb diff --git a/spec/requests/admin/programme_activity_groupings_spec.rb b/spec/requests/admin/programme_activity_groupings_spec.rb new file mode 100644 index 0000000000..c71b3d66fd --- /dev/null +++ b/spec/requests/admin/programme_activity_groupings_spec.rb @@ -0,0 +1,50 @@ +require "rails_helper" + +RSpec.describe "Admin::ProgrammeActivityGroupingsController" do + let(:programme_activity_grouping) do + create(:programme_activity_grouping, + web_copy: { + course_requirements: "Complete this section", + aside_slug: "test-slug", + subtitle: "Complete the activities in this section", + step_number: "three" + } + ) + end + + before do + allow_any_instance_of(Admin::ApplicationController).to receive(:authenticate_admin).and_return("user@example.com") + end + + describe "GET #index" do + before do + get admin_programme_activity_groupings_path + end + + it "should render correct template" do + expect(response).to render_template("index") + end + end + + describe "GET #show" do + before do + get admin_programme_activity_grouping_path(programme_activity_grouping) + end + + it "should render correct template" do + expect(response).to render_template("show") + end + end + + describe "PUT #update" do + before do + put admin_programme_activity_grouping_path(programme_activity_grouping, params: { + programme_activity_grouping: {title: "test"} + }) + end + + it "should redirect to the show page" do + expect(response).to redirect_to(admin_programme_activity_grouping_path(programme_activity_grouping)) + end + end +end From f7593d70b5983363f26ae237b9050d25d9611829 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Fri, 20 Jun 2025 08:54:37 +0000 Subject: [PATCH 08/11] Standardrb fix --- spec/requests/admin/programme_activity_groupings_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/requests/admin/programme_activity_groupings_spec.rb b/spec/requests/admin/programme_activity_groupings_spec.rb index c71b3d66fd..d8c3a6af95 100644 --- a/spec/requests/admin/programme_activity_groupings_spec.rb +++ b/spec/requests/admin/programme_activity_groupings_spec.rb @@ -8,8 +8,7 @@ aside_slug: "test-slug", subtitle: "Complete the activities in this section", step_number: "three" - } - ) + }) end before do From 4eeea926a2ccdfbd04cd79cdeacf9f1a2502b0a4 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Fri, 20 Jun 2025 13:38:20 +0000 Subject: [PATCH 09/11] Programme activity controller not needed --- .../admin/programme_activities_controller.rb | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 app/controllers/admin/programme_activities_controller.rb diff --git a/app/controllers/admin/programme_activities_controller.rb b/app/controllers/admin/programme_activities_controller.rb deleted file mode 100644 index e0a462de74..0000000000 --- a/app/controllers/admin/programme_activities_controller.rb +++ /dev/null @@ -1,46 +0,0 @@ -module Admin - class ProgrammeActivitiesController < Admin::ApplicationController - # Overwrite any of the RESTful controller actions to implement custom behavior - # For example, you may want to send an email after a foo is updated. - # - # def update - # super - # send_foo_updated_email(requested_resource) - # end - - # Override this method to specify custom lookup behavior. - # This will be used to set the resource for the `show`, `edit`, and `update` - # actions. - # - # def find_resource(param) - # Foo.find_by!(slug: param) - # end - - # The result of this lookup will be available as `requested_resource` - - # Override this if you have certain roles that require a subset - # this will be used to set the records shown on the `index` action. - # - # def scoped_resource - # if current_user.super_admin? - # resource_class - # else - # resource_class.with_less_stuff - # end - # end - - # Override `resource_params` if you want to transform the submitted - # data before it's persisted. For example, the following would turn all - # empty values into nil values. It uses other APIs such as `resource_class` - # and `dashboard`: - # - # def resource_params - # params.require(resource_class.model_name.param_key). - # permit(dashboard.permitted_attributes(action_name)). - # transform_values { |value| value == "" ? nil : value } - # end - - # See https://administrate-demo.herokuapp.com/customizing_controller_actions - # for more information - end -end From 45554ba18b399f5a9e00d4d3fea97a09104006c2 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Wed, 16 Jul 2025 08:40:32 +0000 Subject: [PATCH 10/11] Reorder form --- app/dashboards/programme_activity_grouping_dashboard.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dashboards/programme_activity_grouping_dashboard.rb b/app/dashboards/programme_activity_grouping_dashboard.rb index f3ec7db81b..d2d85951df 100644 --- a/app/dashboards/programme_activity_grouping_dashboard.rb +++ b/app/dashboards/programme_activity_grouping_dashboard.rb @@ -42,8 +42,8 @@ class ProgrammeActivityGroupingDashboard < Administrate::BaseDashboard progress_bar_title programme community - web_copy programme_activities + web_copy ].freeze # FORM_ATTRIBUTES From bce28ee7d9376d73c538303c5399ee79fb22e1e0 Mon Sep 17 00:00:00 2001 From: Adam Wheatley Date: Mon, 11 Aug 2025 10:17:49 +0000 Subject: [PATCH 11/11] Update routing after rebase --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index f633160b9d..0e2263a064 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,6 +24,7 @@ resources :pathways resources :pathway_activities resources :programmes, only: [:index, :show] + resources :programme_activity_groupings, only: %i[index show update edit] resources :reports, only: [:index] do collection do get :by_programme @@ -32,7 +33,6 @@ end resources :sent_emails, only: %i[index show] resources :support_audits, only: %i[index show update edit] - resources :programme_activity_groupings, only: %i[index show update edit] resources :users, only: %i[index create show edit perform_sync perform_reset update] do get "/perform_sync/:user_id", to: "users#perform_sync", as: :perform_sync
+ <%= f.label "web_copy[#{k}]", k.humanize %> - + <%= f.text_field "web_copy[#{k}]", value: v %>