Skip to content

Commit

Permalink
Link "How to"^W^WGuides" section from navigation (#1839)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm authored Feb 26, 2021
1 parent 8f832a7 commit 842bf8b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Guides
---

* [Hiding Dashboards from the Sidebar](./guides/hiding_dashboards_from_sidebar)
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
title: How To
title: Hiding Dashboards from the Sidebar
---

## Hiding Dashboards from the Sidebar

Resource can be removed form the sidebar by removing their index action from the routes. For example:
Resources can be removed form the sidebar by removing their index action from the routes. For example:

```ruby
# config/routes.rb
Expand All @@ -18,4 +16,4 @@ Rails.application.routes.draw do
end
```

In this case, only Orders and Products will appear in the sidebar, while Line Items can still appear as an association.
In this case, only Orders and Products will appear in the sidebar, while Line Items can still appear as an association.
1 change: 1 addition & 0 deletions spec/example_app/app/views/layouts/docs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<li><a href="/authorization">Authorization</a></li>
<li><a href="/rails_api">Rails API</a></li>
<li><a href="/extending_administrate">Extending Administrate</a></li>
<li><a href="/guides">Guides</a></li>
</ul>
</div>

Expand Down
2 changes: 1 addition & 1 deletion spec/example_app/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
root to: "customers#index"
end

get "/:page", to: "docs#show"
get "/*page", to: "docs#show"
root to: "docs#index"
end
7 changes: 7 additions & 0 deletions spec/features/documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
expect(page).to have_content("Administrate is released as a Ruby gem")
end

it "shows nested docs pages" do
visit("/guides/hiding_dashboards_from_sidebar")

expect(page).to have_css("div.main h1", text: "Hiding Dashboards from")
expect(page).to have_content("Resources can be removed form the sidebar")
end

it "links to each documentation page" do
visit root_path
links = internal_documentation_links
Expand Down

0 comments on commit 842bf8b

Please sign in to comment.