source 'http://rubygems.org'
-gem 'rails', '3.0.4'
+gem 'rails', '3.0.5'
gem 'pg'
-gem 'arel', '>= 2.0.8'
+gem 'arel', '>= 2.0.9'
gem 'libxml-ruby', '>= 2.0.5', :require => 'libxml'
gem 'rmagick', :require => 'RMagick'
gem 'oauth', '>= 0.4.4'
gem 'memcached'
# Should only load if we're not in database offline mode
-gem 'composite_primary_keys', '>= 3.1.1'
+gem 'composite_primary_keys', '>= 3.1.4'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
require 'rubygems'
# Set up gems listed in the Gemfile.
-gemfile = File.expand_path('../../Gemfile', __FILE__)
-begin
- ENV['BUNDLE_GEMFILE'] = gemfile
- require 'bundler'
- Bundler.setup
-rescue Bundler::GemNotFound => e
- STDERR.puts e.message
- STDERR.puts "Try running `bundle install`."
- exit!
-end if File.exist?(gemfile)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
OpenStreetMap::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
OpenStreetMap::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
OpenStreetMap::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
+# (create the session table with "rails generate session_migration")
# OpenStreetMap::Application.config.session_store :active_record_store
input.disabled = false;
});
});
+
+ Ajax.Responders.register({
+ onCreate: function(request) {
+ var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
+
+ if (csrf_meta_tag) {
+ var header = 'X-CSRF-Token',
+ token = csrf_meta_tag.readAttribute('content');
+
+ if (!request.options.requestHeaders) {
+ request.options.requestHeaders = {};
+ }
+ request.options.requestHeaders[header] = token;
+ }
+ }
+ });
})();