Skip to content

Commit

Permalink
🥔✨ Journal: Sprout Keywords#show
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Jul 13, 2023
1 parent 6f9a625 commit 54eb65c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/furniture/journal/keywords/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%= keyword.canonical_keyword %>
<%= keyword.aliases %>
5 changes: 3 additions & 2 deletions app/furniture/journal/routes.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions spec/furniture/journal/keywords_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Journal
class KeywordsController < Controller
expose(:keyword, scope: -> { policy_scope(journal.keywords) })
def show
authorize(keyword)
end
end
end

0 comments on commit 54eb65c

Please sign in to comment.