app/controllers/effective/regions_controller.rb in effective_regions-1.7.1 vs app/controllers/effective/regions_controller.rb in effective_regions-1.7.2
- old
+ new
@@ -1,13 +1,18 @@
module Effective
class RegionsController < ApplicationController
respond_to :html, :json
layout false
- before_filter :authenticate_user! if defined?(Devise)
- skip_log_page_views :quiet => true, :only => [:snippet] if defined?(EffectiveLogging)
+ if respond_to?(:before_action)
+ skip_before_action :verify_authenticity_token, only: :update
+ before_action :authenticate_user! if defined?(Devise)
+ else
+ skip_before_filter :verify_authenticity_token, only: :update
+ before_filter :authenticate_user! if defined?(Devise)
+ end
- skip_before_filter :verify_authenticity_token, :only => [:update]
+ skip_log_page_views quiet: true, only: [:snippet] if defined?(EffectiveLogging)
def edit
EffectiveRegions.authorized?(self, :edit, Effective::Region.new())
cookies['effective_regions_editting'] = {:value => params[:exit].presence || request.referrer, :path => '/'}