hi everybody i have a problem with refreshing an image after uploading it on the same view. i have redirect_to ''my view'' in my upload method in the same controller after handling image upload. the image should be refreshed but the view is still showing old image. when i push refresh button in browser the image gets refreshed. any suggestions? ps: i tried in firefox and ie also. thank you -- Posted via http://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 -~----------~----~----~----~------~----~------~--~---
Add this code in the my view... <body onLoad="window.opener.location=window.opener.location; window.close()"> sine wrote:> hi everybody > > i have a problem with refreshing an image after uploading it on the same > view. > i have redirect_to ''my view'' in my upload method in the same controller > after handling image upload. > the image should be refreshed but the view is still showing old image. > when i push refresh button in browser the image gets refreshed. > > any suggestions? > > ps: i tried in firefox and ie also. > > thank you-- Posted via http://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 -~----------~----~----~----~------~----~------~--~---
Naga harish Kanegolla wrote: i tried but still dont work, and my browser shows me javascript error window.opener is null not an object?> Add this code in the my view... > <body onLoad="window.opener.location=window.opener.location; > window.close()"> > > sine wrote: >> hi everybody >> >> i have a problem with refreshing an image after uploading it on the same >> view. >> i have redirect_to ''my view'' in my upload method in the same controller >> after handling image upload. >> the image should be refreshed but the view is still showing old image. >> when i push refresh button in browser the image gets refreshed. >> >> any suggestions? >> >> ps: i tried in firefox and ie also. >> >> thank you-- Posted via http://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 -~----------~----~----~----~------~----~------~--~---
Try this,
add this code in the method "save".
def save
  if @picture.save
      redirect_to :action => ''saved_picture''
      return
  end
end
and in saved_picture.rhtml  u put this,<body 
onLoad="window.opener.location=window.opener.location;
window.close()">
I think it should work..
Harish
-- 
Posted via http://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
-~----------~----~----~----~------~----~------~--~---