Permalink
Browse files

Change parent controller to ActionController::Base for out-of-box sup…

…port of Rails 5 API mode

To keep old behavior, add `config.parent_controller = '::ApplicationController'` in your RailsAdmin initializer.

Fixes #2688
  • Loading branch information...
mshibuya committed Aug 14, 2016
1 parent 437df79 commit 53eef4fe2ec0953381f4e3197c885adc0423dd49
Showing with 6 additions and 2 deletions.
  1. +3 −0 CHANGELOG.md
  2. +1 −1 lib/rails_admin/config.rb
  3. +2 −1 lib/rails_admin/engine.rb
@@ -4,6 +4,9 @@

[Full Changelog](https://github.com/sferik/rails_admin/compare/v1.0.0.rc...HEAD)

### Changed
- Change parent controller to ActionController::Base for out-of-box support of Rails 5 API mode([#2688](https://github.com/sferik/rails_admin/issues/2688))
- To keep old behavior, add `config.parent_controller = '::ApplicationController'` in your RailsAdmin initializer.

## [1.0.0.rc](https://github.com/sferik/rails_admin/tree/v1.0.0.rc) - 2016-07-18

@@ -283,7 +283,7 @@ def reset
@show_gravatar = true
@navigation_static_links = {}
@navigation_static_label = nil
@parent_controller = '::ApplicationController'
@parent_controller = '::ActionController::Base'
RailsAdmin::Config::Actions.reset
end

@@ -23,7 +23,8 @@ class Engine < Rails::Engine
)
end

initializer 'RailsAdmin pjax hook' do |app|
initializer 'RailsAdmin setup middlewares' do |app|
app.config.middleware.use ActionDispatch::Flash
app.config.middleware.use Rack::Pjax
end

1 comment on commit 53eef4f

@luizpicolo

This comment has been minimized.

Copy link
Contributor

luizpicolo commented on 53eef4f Aug 17, 2016

this is caused a rspec error

Please sign in to comment.