If you want a link to download a file from JavaScript, handle the onclick event and return a full page redirect to the file. It won't actually navigate the page to the new URL unless the URL is something that a browser can actually show (the file will just download). You mention an image -- you will probably need to set Rails to send this file as an attachment, since the browser will believe that it can handle an image. Some browsers are unwilling to be led, though, and you will still show the image. In that case, I find that Zipping the file is a great way to force the issue.
Walter
>
> Thank you
> vishnu
>
>
>
> --
> 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
rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/WuF4kLBQjWcJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>