jejacks0n / mercury

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

After upgrading to new version can't save #238

Closed ivl closed 12 years ago

ivl commented 12 years ago

After upgrading to new version - can't save page content. Can't find m,ercury_update method.

In routes.rb

resources :servicepages do member do
post :mercury_update end
end

worked perfect with previiouse version

gvarela commented 12 years ago

The default route verb was changed from a post to a put to follow rails conventions more closely. You either need to change the configuration for bootstrapping the editor to a post or your route to a put.

Gabe Varela 303-638-6576

On Jun 20, 2012, at 8:12 AM, Ihor Vlasiukreply@reply.github.com wrote:

After upgrading to new version - can't save page content. Can't find m,ercury_update method.

In routes.rb

resources :servicepages do member do
post :mercury_update end
end

worked perfect with previiouse version


Reply to this email directly or view it on GitHub: https://github.com/jejacks0n/mercury/issues/238

ivl commented 12 years ago

How can I set up as mercury use post method?

gvarela commented 12 years ago

Create your own layout to initialize the editor. The comments in this layout describe how to configure it https://github.com/jejacks0n/mercury/blob/master/app/views/layouts/mercury.html.erb

ivl commented 12 years ago

Hmmm. Is it possible to add this code on mercury.js? i want to fix issue on production ASAP without rewriting anything?

gvarela commented 12 years ago

Because of inherited views in Rails you just have to drop that layout in your own project and tweak it. It is actually a choice in the install generator to do so.

The other option is to bind to the Mercury ready event and change the options instance var.

Mercury.on('ready', function(){
  window.mercuryInstance.options.saveMethod = 'PUT';
});
ivl commented 12 years ago

Thanks for you support. It works perfect. Thanks