From 8cf15c042fa2069b1212afd3893f772620e588e3 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/routes.rb | 5 +++-- app/furniture/journal/terms/show.html.erb | 2 ++ spec/furniture/journal/terms_controller.rb | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/furniture/journal/terms/show.html.erb create mode 100644 spec/furniture/journal/terms_controller.rb diff --git a/app/furniture/journal/routes.rb b/app/furniture/journal/routes.rb index ab0e5a911..d274a6172 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 :terms, only: [:show] end end end diff --git a/app/furniture/journal/terms/show.html.erb b/app/furniture/journal/terms/show.html.erb new file mode 100644 index 000000000..ba987094a --- /dev/null +++ b/app/furniture/journal/terms/show.html.erb @@ -0,0 +1,2 @@ +<%= term.canonical_keyword %> +<%= term.aliases %> diff --git a/spec/furniture/journal/terms_controller.rb b/spec/furniture/journal/terms_controller.rb new file mode 100644 index 000000000..4c0709452 --- /dev/null +++ b/spec/furniture/journal/terms_controller.rb @@ -0,0 +1,8 @@ +class Journal + class TermsController < Controller + expose(:term, scope: -> { policy_scope(journal.terms) }) + def show + authorize(term) + end + end +end