Skip to content

Commit

Permalink
Document how to use with Rails API (thoughtbot#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorganIO authored and nickcharlton committed Apr 5, 2017
1 parent 1d3a46a commit 3bc026f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ visit <http://localhost:3000/admin> to see your new dashboard in action.

## Create Additional Dashboards

In order to create additional dashboards, pass in the resource name to
In order to create additional dashboards, pass in the resource name to
the dashboard generator. A dashboard and controller will be created.

```bash
Expand All @@ -58,3 +58,19 @@ namespace :admin do
resources :foos
end
```

## Rails API

Since Rails 5.0, we've been able to have API only applications. Yet, sometimes
we still want to have an admin. To get this working, please update this config:

```ruby
# config/application.rb
config.api_only = false
```

That means, when your app _boots_, we'll have access to flashes and such. We
also don't use your `ApplicationController`. Instead, Administrate provides its
own. Meaning you're free to specify `ActionController::API` as your parent
controller to make sure no flash, session, or cookie middleware is used by your
API.

0 comments on commit 3bc026f

Please sign in to comment.