* Add Oj to Ruby On Rails * Fix Date header in Ruby On Rails
@@ -7,3 +7,4 @@ gem 'activerecord-import', '0.27.0'
gem 'activerecord', '5.2.2', :require => 'active_record'
gem 'rails', '5.2.2'
gem 'tzinfo-data', '1.2018.7'
+gem 'oj', '3.7.9'
@@ -1,2 +1,11 @@
class ApplicationController < ActionController::Base
+
+ before_action :add_header
+protected
+ def add_header
+ response.set_header('Date', Time.now.httpdate)
+ end
end
@@ -27,6 +27,6 @@ module Hello
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
- config.action_dispatch.default_headers.merge!('Date' => Time.now.httpdate, 'Server' => 'WebServer')
+ config.action_dispatch.default_headers.merge!('Server' => 'WebServer')
@@ -0,0 +1 @@
+Oj.optimize_rails