Skip to content

Commit bd18720

Browse files
wireframeseanpdoyle
authored andcommitted
Cleanup check for html content type
[`Mime::Type.html?`][docs] is a publicly available API that internally uses a regex. [docs]: http://api.rubyonrails.org/classes/Mime/Type.html#method-i-html-3F
1 parent 760766c commit bd18720

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

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

4+
* Use `Mime::Type.html?`
5+
6+
[#523]: https://github.com/thoughtbot/ember-cli-rails/pull/523
7+
48
0.8.4
59
-----
610

lib/ember_cli/ember_constraint.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ def rails_info_request?(request)
1111
end
1212

1313
def html_request?(request)
14-
index = request.format.to_s =~ /html/ || -1
15-
16-
index > -1
14+
request.format.html?
1715
end
1816
end
1917
end

0 commit comments

Comments
 (0)