jejacks0n / mercury

Mercury Editor: The Rails WYSIWYG editor that allows embedding full page editing capabilities directly inline.
http://jejacks0n.github.com/mercury
Other
2.64k stars 531 forks source link

ActionController::RoutingError (No route matches [POST] "/mercury/snippets/example/options.html"): #392

Open sandric opened 11 years ago

sandric commented 11 years ago

In routes we have

Mercury::Engine.routes.draw do
  get '/editor(/*requested_uri)' => "mercury#edit", :as => :mercury_editor

  scope '/mercury' do
    get ':type/:resource' => "mercury#resource"
    get 'snippets/:name/options' => "mercury#snippet_options"
    get 'snippets/:name/preview' => "mercury#snippet_preview"
  end
end

But in mercury.js config file options and preview are routed through GET method, and with .html file extension:

snippets: {
      method: 'POST',
      optionsUrl: '/mercury/snippets/:name/options.html',
      previewUrl: '/mercury/snippets/:name/preview.html'
      },

So after open testing snippets panel and paste snippet from it, I got

ActionController::RoutingError (No route matches [POST] "/mercury/snippets/example/options.html"):

Changing one routes.rb to post or mercury.js to get the problem disappears.

Is anyone else saw this?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/459859-actioncontroller-routingerror-no-route-matches-post-mercury-snippets-example-options-html?utm_campaign=plugin&utm_content=tracker%2F134071&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F134071&utm_medium=issues&utm_source=github).
jejacks0n commented 11 years ago

Keeps the folks who don't understand it from using it. ;-p


Jeremy Jackson

On Jun 22, 2013, at 3:41 AM, sandric notifications@github.com wrote:

In routes we have

Mercury::Engine.routes.draw do get '/editor(/*requested_uri)' => "mercury#edit", :as => :mercury_editor

scope '/mercury' do get ':type/:resource' => "mercury#resource" get 'snippets/:name/options' => "mercury#snippet_options" get 'snippets/:name/preview' => "mercury#snippet_preview" end end But in mercury.js config file options and preview are routed through GET method, and with .html file extension:

snippets: { method: 'POST', optionsUrl: '/mercury/snippets/:name/options.html', previewUrl: '/mercury/snippets/:name/preview.html' }, So after open testing snippets panel and paste snippet from it, I got

ActionController::RoutingError (No route matches [POST] "/mercury/snippets/example/options.html"):

Changing one routes.rb to post or mercury.js to get the problem disappears.

Is anyone else saw this?

— Reply to this email directly or view it on GitHub.