Bump. Help me please.
On Aug 27, 11:42 am, Kim
<Kim.Gri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I can upload, edit and view images just fine. But, I am having
> problems deleting the images.
>
> I have tried:
> @mod.data = nil
> this returns the error:
> Exception in edit_module: You have a nil object when you didn''t
expect
> it!
> You might have expected an instance of Array.
> The error occured while evaluating nil.size
>
> It looks like it is trying to resize the image which is now nil.
>
> Also tried:
>
> @mod.data = '' ''
> This didn''t do anything
>
> I am all ears on how to delete the image. Thanks.
>
> Model
> -----------
> class LibResource < FlexImage::Model
> self.require_image_data = false
> pre_process_image :size => ''250x250''
>
> Controller
> --------------
> if request.post?
> @mod.attributes = params[:mod] #updates the model as usual
>
> ....
> if params[:image_options]
> option = params[:image_options]
> if option == ''Remove my image''
> @mod.data = nil
> @mod.save!
> end
> end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---