Skip to content

Commit

Permalink
Add example for adding controllers without a related model docs (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorfeijo authored Sep 10, 2020
1 parent 6a220a6 commit 5a5db7d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/adding_controllers_without_related_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ class StatDashboard < Administrate::CustomDashboard
end
```

```ruby
# app/controllers/admin/stats_controller.rb
module Admin
class StatsController < Admin::ApplicationController
def index
@stats = {
customer_count: Customer.count,
order_count: Order.count,
}
end
end
end
```

```ruby
# config/routes.rb
namespace :admin do
Expand Down

0 comments on commit 5a5db7d

Please sign in to comment.