diff --git a/Gemfile b/Gemfile index 1c7700e..3b34e4a 100644 --- a/Gemfile +++ b/Gemfile @@ -51,6 +51,9 @@ gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" +# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible +gem "rack-cors" + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] diff --git a/Gemfile.lock b/Gemfile.lock index 8dee3eb..9865dc2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -137,6 +137,8 @@ GEM nio4r (~> 2.0) racc (1.6.0) rack (2.2.4) + rack-cors (1.1.1) + rack (>= 2.0.0) rack-test (2.0.2) rack (>= 1.3) rails (7.0.3) @@ -212,6 +214,7 @@ DEPENDENCIES jbuilder pg (~> 1.1) puma (~> 5.0) + rack-cors rails (~> 7.0.2, >= 7.0.2.4) sprockets-rails stimulus-rails diff --git a/app/controllers/properties_controller.rb b/app/controllers/properties_controller.rb new file mode 100644 index 0000000..8912da2 --- /dev/null +++ b/app/controllers/properties_controller.rb @@ -0,0 +1,64 @@ +class PropertiesController