I want to improve my pages with some Visual Editor and have find this railcast about Mercury editor. All Done's, but when i pressed SAVE, I had redirected to my page without any changes. No errors, no warnings, just UNSAVED FORMATTING. Can anybody helps me?
Some code:
# routes:
mount Mercury::Engine => '/'
resources :tasks do
resources :comments
member { post :mercury_update }
end
# My controller:
def mercury_update
task = Task.find(params[:id])
task.title = params[:title][:value]
task.body_task = params[:body_task][:value]
task.save!
render text: ""
end
# In views/layouts/mercury.html.erb
new Mercury.PageEditor(saveUrl, {
saveStyle: 'form', // 'form', or 'json' (default json)
saveMethod: null, // 'PUT', or 'POST', (create, vs. update -- default PUT)
visible: true // boolean - if the interface should start visible or not
});
#when using 'POST' i have alert 'Mercury was unable to save to the url'
P.S. Rails 3.2.8, mercury-rails (0.8.0)