Skip to content

Commit 008779d

Browse files
committed
Adding pgHero to the admin sidebar
1 parent 68ba2e2 commit 008779d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

app/views/layouts/admin.html.slim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
= link_to admin_imap_sync_states_path, class: admin_nav_link_class(:imap_sync) do
1919
i.fas.fa-sync
2020
span IMAP Sync
21+
= link_to admin_pg_hero.root_path, class: admin_nav_link_class(:pghero) do
22+
i.fas.fa-database
23+
span PgHero
2124

2225
= render template: 'layouts/application'

config/routes.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
post :preview
1818
end
1919
end
20+
mount PgHero::Engine, at: "/pghero" if defined?(PgHero)
2021
end
2122
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
2223

@@ -115,12 +116,6 @@
115116
post "messages/:id/read", to: "messages#read", as: :read_message
116117
resources :attachments, only: [:show]
117118

118-
if defined?(PgHero)
119-
constraints AdminConstraint.new do
120-
mount PgHero::Engine, at: "/pghero"
121-
end
122-
end
123-
124119
if Rails.env.development?
125120
mount LetterOpenerWeb::Engine, at: "/letter_opener"
126121
end

0 commit comments

Comments
 (0)