you should use a plugin called responds_to_parent :
http://agilewebdevelopment.com/plugins/responds_to_parent
On Nov 9, 3:34 am, Ghee wooi Ong
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> hi,
>
> I write a page that contain following function:
>
> this site contain a html file upload control, which allow user to upload
> image only.
>
> once the image had been uploaded, it will automatic display on the
> current page without refresh entire page.
>
> when the image is saved, it will return javascript that embed in a
> iframe (which is also in my current page) that can load the image into
> my page ( say in <div id="photo container"> element).
>
> however, when upload an invalid file (I use attachment_fu''s
> validate_as_attachment), the error result is return to iframe due to
> iframe is the target of form ( form id="uploader"
target="my_iframe"> )
>
> I wanna display the error message, but the code is stop after entire
> page with error is return to my iframe.
>
> my code look this :
>
> def create
> begin
> #success code logic
> rescue
> render :action=>''new'' #return entire template in
iframe,
> end
> end
>
> is that any way to display in error in main page?
>
> Is that any possible solution for it ?
>
> kiwi
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---