Sha256: b7b14ebc32c486348889da4d74e78aeb74205b37ef9ed965168971d85419cf5f

Contents?: true

Size: 883 Bytes

Versions: 1

Compression:

Stored size: 883 Bytes

Contents

class Spree::PossiblePage
  def self.matches?(request) 
    return false if request.fullpath =~ /(^\/+(admin|account|cart|checkout|content|login|pg\/|orders|products|s\/|session|signup|shipments|states|t\/|tax_categories|user)+)/
    !Spree::Page.active.find_by_path(request.fullpath).nil?
  end
end

Spree::Core::Engine.routes.append do
  
  namespace :admin do
    
    resources :pages, :constraints => { :id => /.*/ } do
      collection do
        post :update_positions
      end
    
      resources :contents do
        collection do
          post :update_positions
        end
      end
    
      resources :images, :controller => "page_images" do
        collection do
          post :update_positions
        end
      end
    end

  end
  
  constraints(Spree::PossiblePage) do
    get '(:page_path)', :to => 'pages#show', :page_path => /.*/, :as => :page
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_essential_cms-0.4.0 config/routes.rb