jejacks0n/mercury

Unable to find object on /edit/ path

ogonki-vetochki opened this issue · 0 comments

My routes.rb:

    DigitalizmAdmin::Application.routes.draw do
      ## Admin routes
      namespace :mercury do
        resources :images
      end
      mount Mercury::Engine => '/'

      devise_for :admins #, :skip => [:registrations, :passwords]
      namespace :admin do
        root :to => "admin#dashboard"

        resources :categories do
          member { post :mercury_update }
        end
        resources :posts do
          member { post :mercury_update }
        end
        resources :pages do
          member { post :mercury_update }
        end
      end

      ## Regular routes
      root to: "welcome#index"

      get 'posts/*categories_uri/:post_uri' => "posts#show"
      get 'categories/*categories_uri' => "categories#show"

      # here is the regular page route
      get 'page/:uri' => "pages#show", as: :page
      get 'sitemap/*categories_uri' => 'sitemap#show'
      get 'sitemap' => 'sitemap#index'

      ## Catch all unexisted routes
      match "*path", to: "application#render_404", via: :all
    end

Here is how I construct link to edit in view:

    = link_to "Edit", "/editor" + page_path(item)

On the route host/page/:slug I can see the page, but when Im on route host/edit/page/:slug
I have 404 error.


In the browser console I can see error:
GET http://host/page/:slug?mercury_frame=true&_=1388132782182 404 (Not Found)
But all mercury-editor's js files have been loaded.