From 0f540b50d5db07b049281d4d064d3651fe20e4b3 Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:38:47 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=94=E2=9C=A8=20`Journal`:=20Sprout=20`?= =?UTF-8?q?Terms#show`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/zinc-collective/convene/issues/1566 --- app/furniture/journal/keywords/show.html.erb | 2 ++ app/furniture/journal/routes.rb | 5 +++-- spec/furniture/journal/keywords_controller.rb | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/furniture/journal/keywords/show.html.erb create mode 100644 spec/furniture/journal/keywords_controller.rb diff --git a/app/furniture/journal/keywords/show.html.erb b/app/furniture/journal/keywords/show.html.erb new file mode 100644 index 000000000..a9de1d323 --- /dev/null +++ b/app/furniture/journal/keywords/show.html.erb @@ -0,0 +1,2 @@ +<%= keyword.canonical_keyword %> +<%= keyword.aliases %> diff --git a/app/furniture/journal/routes.rb b/app/furniture/journal/routes.rb index ab0e5a911..008cc0fd0 100644 --- a/app/furniture/journal/routes.rb +++ b/app/furniture/journal/routes.rb @@ -1,8 +1,9 @@ class Journal class Routes def self.append_routes(router) - router.resources :journals do - router.resources :entries, module: "journal" + router.resources :journals, module: "journal" do + router.resources :entries + router.resources :keywords, only: [:show] end end end diff --git a/spec/furniture/journal/keywords_controller.rb b/spec/furniture/journal/keywords_controller.rb new file mode 100644 index 000000000..2792f7c7d --- /dev/null +++ b/spec/furniture/journal/keywords_controller.rb @@ -0,0 +1,8 @@ +class Journal + class KeywordsController < Controller + expose(:keyword, scope: -> { policy_scope(journal.keywords) }) + def show + authorize(keyword) + end + end +end