add rack-cors; fix #531

This commit is contained in:
Devin Howard 2016-04-05 10:12:12 +08:00
parent 8a6d434fc3
commit 7de642ccb2
3 changed files with 11 additions and 0 deletions

View file

@ -18,6 +18,7 @@ gem 'kaminari' # pagination
gem 'uservoice-ruby'
gem 'dotenv'
gem 'snorlax'
gem 'rack-cors'
gem 'httparty'
gem 'active_model_serializers', '~> 0.8.1'
gem 'delayed_job', '~> 4.0.2'

View file

@ -160,6 +160,7 @@ GEM
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4)
rack-cors (0.4.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.4)
@ -286,6 +287,7 @@ DEPENDENCIES
pundit
pundit_extra
quiet_assets
rack-cors
rails (= 4.2.4)
rails3-jquery-autocomplete
rails_12factor

View file

@ -0,0 +1,8 @@
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*',
headers: :any,
methods: [:get, :post, :put, :delete, :options, :head]
end
end