Just took out the extra lines for storing the "attachable" object, and
now I get a friendly JS alert saying:
"Couldn't create the image attachment. Image must be set"
that seems to be coming from paperclip.
Could this be something to do with the fact that its not the calling
model thats having an image uploaded to it?
Could it be the with="&ImageAttachment.new" thats causing problems?
This was all working previously (albeit less ajax) - I still have a
feeling it might be something in edge Hobo thats causing issues.
On Nov 25, 5:03 pm, adamski <[EMAIL PROTECTED]> wrote:
> Thanks, that plugin does look useful.
> I just installed and got it working, but come up against the same
> error :-/
>
> The code is within a tag for use across different models.
> It currently reads:
>
> <def tag="add-image-attachment" attrs="object">
> <if test="&object">
> <div class="ipstext">
> <a href="javascript:void(0);" onclick="Effect.toggle
> ('attachment_form','slide',{duration:0.5}); return false"><img src="../
> images/icons/plussmall.gif" alt="add image attachment" title="add
> image attachment" /></a>
> </div>
>
> <div id="attachment_form" style="display:none;">
>
> <form with="&ImageAttachment.new" multipart
> update="image-
> attachments" >
>
> <input:image />
>
> <input id="image_attachment[attachable_type]"
> name="image_attachment[attachable_type]" type="hidden"
> value="&object.class.name" />
> <input id="image_attachment[attachable_id]"
> name="image_attachment
> [attachable_id]" type="hidden" value="&object.id" />
>
> <input type="image"
> src="../images/buttons/submit.gif"
> value="Submit" />
>
> </form>
> </div>
> </if>
> <else>
> <p>Error (add-image-attachment): Object not given - use
> add-image-
> attachment object="&blah"</p>
> </else>
> </def>
>
> On Nov 25, 4:23 pm, Tom Locke <[EMAIL PROTECTED]> wrote:
>
> > This might be useful
>
> >http://github.com/tablatom/paperclip_with_hobo
>
> > Once that's installed the form should just be
>
> > <form multipart>
> > <input:image/>
> > <submit/>
> > </form>
>
> > Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---