1
0

Deal with cross origins

This commit is contained in:
Andrew Tomaka 2015-10-27 09:42:56 -04:00
parent 092d712378
commit 7e82b16f29
3 changed files with 10 additions and 15 deletions

View File

@ -18,6 +18,7 @@ gem 'omniauth-reddit', :git => 'git://github.com/jackdempsey/omniauth-reddit.git
gem 'active_model_serializers'
gem 'paper_trail'
gem 'paperclip', '~> 4.3'
gem 'rack-cors'
# AUTHORIZATION
gem 'pundit'

View File

@ -145,6 +145,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)
@ -253,6 +254,7 @@ DEPENDENCIES
puma
pundit
quiet_assets
rack-cors
rails (= 4.2.4)
rails-erd
rails_12factor

View File

@ -11,25 +11,17 @@ require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module DbzdokkanRails
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.middleware.insert_before 0, "Rack::Cors" do
allow do
origins '*'
resource '*', headers: :any, methods: [:get]
end
end
end
end