Skip to content

Commit 6ee1254

Browse files
committed
Fix EmberCli::EmberController inheritance
The `EmberCli::EmberController` used to inherit from `ApplicationController` in order to reap the benefits of application-wide configurations and behavior (such as authentication-based `before_action` calls and other macros). Unfortunately, with the introduction of Rails 5's `rails new --api`, applications' `ApplicationController` can now inherit from [`ActionController::API`][api], which doesn't serve HTML by default. To support Rails 5's default `--api` behavior, `EmberCli::EmberController` must inherit from `ActionController::Base`, forcing the controller to forfeit all the benefits of sharing behavior with `ApplicationController`.
1 parent f948b96 commit 6ee1254

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
master
22
------
33

4+
* `EmberCli::EmberController` now inherits from `ActionController::Base` instead
5+
of `ApplicationController`. [#400]
46
* Remove support for Ruby 2.1.x. [#400]
57
* Enhance `rake ember:install` to fully reinstall if necessary. [#396]
68
* `EmberCli::Deploy::File` serves assets with Rails' `static_cache_control`

app/controller/ember_cli/ember_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module EmberCli
2-
class EmberController < ::ApplicationController
2+
class EmberController < ActionController::Base
33
def index
44
render layout: false
55
end

0 commit comments

Comments
 (0)