Sha256: 08a7bcadc01a115fce24e83e32bf689ad4e5a65a1f17d6c6b7effdc8e18396ab

Contents?: true

Size: 399 Bytes

Versions: 43

Compression:

Stored size: 399 Bytes

Contents

module Releaf::ActionController::Ajax
  extend ActiveSupport::Concern

  included do
    helper_method :ajax?
    before_action :manage_ajax
  end

  def ajax?
    @_ajax || false
  end

  def layout
    ajax? ? false : "releaf/admin"
  end

  def manage_ajax
    @_ajax = params.has_key? :ajax
    if @_ajax
      request.query_parameters.delete(:ajax)
      params.delete(:ajax)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
releaf-core-3.1.0 app/lib/releaf/action_controller/ajax.rb
releaf-core-3.0.3 app/lib/releaf/action_controller/ajax.rb
releaf-core-3.0.2 app/lib/releaf/action_controller/ajax.rb
releaf-core-3.0.1 app/lib/releaf/action_controller/ajax.rb
releaf-core-3.0.0 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.2.1 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.2.0 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.1.2 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.1.1 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.1.0 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.0.1 app/lib/releaf/action_controller/ajax.rb
releaf-core-2.0.0 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.22 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.21 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.20 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.19 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.18 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.17 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.16 app/lib/releaf/action_controller/ajax.rb
releaf-core-1.1.15 app/lib/releaf/action_controller/ajax.rb