jejacks0n/mercury — Issue #133: Rendering partial in Mercury modal
Author: shreyas-satish
Created: 2012-01-17 07:05:25+00:00
State: open

I'm trying to extend the Mercury toolbar with a custom Action/Behaviour.
The action I've defined in my mercury.js

toolbars: {
imageUpload: ['Upload Image', 'Inserts an image']
}

The behavior I've defined in my mercury.js

behaviors: {
imageUpload: function(selection) {
Mercury.modal('/admin/assets/image_upload', { title: 'Upload Image', fullHeight: true, handler: 'imageUploader' });
}

I've of course defined the corresponding route and controller#action as well. When I click on my custom image upload icon, the request/response is as follows:

Started GET "/admin/assets/image_upload" for 127.0.0.1 at 2012-01-17 12:23:16 +0530
Processing by Admin::AssetsController#image_upload as */*
Rendered admin/assets/image_upload.html (0.0ms)
Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.0ms)

But in the mercury editor I get

Mercury was unable to load /admin/assets/image_upload for the modal.

Basically I'm trying to render a partial, preferably erb, when the custom button is clicked. How can I achieve that?

Thanks