summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorGavin Miller <gavingmiller@gmail.com>2014-02-22 19:13:10 -0700
committerGavin Miller <gavingmiller@gmail.com>2014-02-22 19:13:10 -0700
commit18743c5981c59708d4143dfe75a5c111e67355e4 (patch)
tree24901e40807d12df39f1259144f4a9f06127723b /app/controllers/application_controller.rb
parent1fe046fd801be497f6176a1f882359ffcfaf6ce1 (diff)
parentec7a4537c4559613e65e79ab780041c9666817b9 (diff)
Merge pull request #1 from mokhan/solution
Mergity Mergity Mergity
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
new file mode 100644
index 0000000..419e9b0
--- /dev/null
+++ b/app/controllers/application_controller.rb
@@ -0,0 +1,18 @@
+class ApplicationController < ActionController::Base
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :null_session
+ before_filter :load_additional_payload_data
+ rescue_from StandardError, with: :return_server_error unless Rails.env.development?
+
+ def load_additional_payload_data
+ @license_statuses = LicenseStatus::ALL
+ @well_types = WellType::ALL
+ end
+
+ private
+
+ def return_server_error
+ render nothing: true, status: :internal_server_error
+ end
+end