Sha256: 8e9632abb36b40bf53ba7f1a27d05d4d915851f1219fca304bc27c0e504173a5

Contents?: true

Size: 378 Bytes

Versions: 9

Compression:

Stored size: 378 Bytes

Contents

module CMS
  module Editing
    extend ActiveSupport::Concern

    included do
      before_action :set_edit_mode

      helper_method :cms_edit_mode?
    end

    def cms_edit_mode?
      @_editing ||= current_admin? && session[:edit_mode].to_b
    end

    private

    def set_edit_mode
      session[:edit_mode] = params[:edit_mode] || session[:edit_mode]
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_admin_cms-0.1.1 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.9 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.7 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.6 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.5 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.4 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.3 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.2 app/controllers/concerns/cms/editing.rb
rails_admin_cms-0.0.1 app/controllers/concerns/cms/editing.rb