Skip to content

Commit

Permalink
Change parent controller to ActionController::Base for out-of-box sup…
Browse files Browse the repository at this point in the history
…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 53eef4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion lib/rails_admin/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

1 comment on commit 53eef4f

@luizpicolo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is caused a rspec error

Please sign in to comment.